{
  "openapi": "3.1.1",
  "info": {
    "title": "DigiCardSystem API",
    "description": "Firmanızın dijital kartvizitlerine ve kart formundan gelen taleplere kendi API anahtarınızla erişin. Anahtar panelde API Anahtarları ekranından oluşturulur; istekte 'Authorization: Bearer dcs_…' başlığıyla gönderilir. Anahtar başına dakikada 120 istek. Belgeler: https://digicardsystem.com/gelistiriciler",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://digicardsystem.com/"
    }
  ],
  "paths": {
    "/api/v1/cards": {
      "get": {
        "tags": [
          "CardsApi"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPageOfApiCard"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "CardsApi"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCardCreate"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCardCreate"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCardCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCard"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cards/{id}": {
      "get": {
        "tags": [
          "CardsApi"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCard"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "CardsApi"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCardPatch"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCardPatch"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCardPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCard"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cards/{id}/deactivate": {
      "post": {
        "tags": [
          "CardsApi"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCard"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cards/{id}/activate": {
      "post": {
        "tags": [
          "CardsApi"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCard"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads": {
      "get": {
        "tags": [
          "LeadsApi"
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cardId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPageOfApiLead"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "MeApi"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiMe"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiCard": {
        "required": [
          "id",
          "slug",
          "firstName",
          "lastName",
          "title",
          "department",
          "company",
          "email",
          "phone",
          "mobile",
          "website",
          "linkedInUrl",
          "instagramUrl",
          "xUrl",
          "about",
          "titleEn",
          "departmentEn",
          "companyEn",
          "aboutEn",
          "isActive",
          "leadCaptureEnabled",
          "publicUrl",
          "vCardUrl",
          "totalScans",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "company": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "linkedInUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "instagramUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "xUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "about": {
            "type": [
              "null",
              "string"
            ]
          },
          "titleEn": {
            "type": [
              "null",
              "string"
            ]
          },
          "departmentEn": {
            "type": [
              "null",
              "string"
            ]
          },
          "companyEn": {
            "type": [
              "null",
              "string"
            ]
          },
          "aboutEn": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "leadCaptureEnabled": {
            "type": "boolean"
          },
          "publicUrl": {
            "type": "string"
          },
          "vCardUrl": {
            "type": "string"
          },
          "totalScans": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiCardCreate": {
        "required": [
          "firstName",
          "lastName"
        ],
        "type": "object",
        "properties": {
          "slug": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "maxLength": 255,
            "type": "string"
          },
          "lastName": {
            "maxLength": 255,
            "type": "string"
          },
          "company": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "title": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "linkedInUrl": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "instagramUrl": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "xUrl": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "about": {
            "maxLength": 2000,
            "type": [
              "null",
              "string"
            ]
          },
          "titleEn": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "departmentEn": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "companyEn": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "aboutEn": {
            "maxLength": 2000,
            "type": [
              "null",
              "string"
            ]
          },
          "leadCaptureEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiCardPatch": {
        "type": "object",
        "properties": {
          "slug": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "company": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "linkedInUrl": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "instagramUrl": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "xUrl": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "about": {
            "maxLength": 2000,
            "type": [
              "null",
              "string"
            ]
          },
          "titleEn": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "departmentEn": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "companyEn": {
            "maxLength": 255,
            "type": [
              "null",
              "string"
            ]
          },
          "aboutEn": {
            "maxLength": 2000,
            "type": [
              "null",
              "string"
            ]
          },
          "leadCaptureEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ApiLead": {
        "required": [
          "id",
          "cardId",
          "cardSlug",
          "name",
          "email",
          "phone",
          "message",
          "capturedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "cardId": {
            "type": "string",
            "format": "uuid"
          },
          "cardSlug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          },
          "capturedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiMe": {
        "required": [
          "company",
          "plan",
          "usage",
          "key"
        ],
        "type": "object",
        "properties": {
          "company": {
            "$ref": "#/components/schemas/ApiMeCompany"
          },
          "plan": {
            "$ref": "#/components/schemas/ApiMePlan"
          },
          "usage": {
            "$ref": "#/components/schemas/ApiMeUsage"
          },
          "key": {
            "$ref": "#/components/schemas/ApiMeKey"
          }
        }
      },
      "ApiMeCompany": {
        "required": [
          "id",
          "slug",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ApiMeKey": {
        "required": [
          "prefix",
          "scopes",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ApiMePlan": {
        "required": [
          "code",
          "name",
          "maxCards",
          "maxUsers"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "maxCards": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxUsers": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiMeUsage": {
        "required": [
          "activeCards",
          "activeUsers"
        ],
        "type": "object",
        "properties": {
          "activeCards": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "activeUsers": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiPageOfApiCard": {
        "required": [
          "items",
          "page",
          "pageSize",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiCard"
            }
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiPageOfApiLead": {
        "required": [
          "items",
          "page",
          "pageSize",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiLead"
            }
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "Firma API anahtarı (panel → API Anahtarları).",
        "scheme": "bearer",
        "bearerFormat": "dcs_…"
      }
    }
  },
  "security": [
    {
      "bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "CardsApi"
    },
    {
      "name": "LeadsApi"
    },
    {
      "name": "MeApi"
    }
  ]
}