{
  "openapi": "3.0.1",
  "info": {
    "title": "FirstPromoter Affiliate Campaigns API",
    "version": "1.0",
    "description": "Get all campaigns "
  },
  "servers": [
    {
      "url": "https://api.firstpromoter.com/api/v2/affiliate"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/campaigns": {
      "get": {
        "summary": "Get all campaigns",
        "description": "Returns all campaigns  \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/campaigns`</Tip>",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountId"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "ID of the campaign"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the campaign"
                      },
                      "color": {
                        "type": "string",
                        "nullable": true,
                        "description": "Color associated with the campaign"
                      }
                    },
                    "description": "Campaign object"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code"
                    }
                  },
                  "description": "Error response"
                }
              }
            }
          },
          "404": {
            "description": "Record not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code"
                    }
                  },
                  "description": "Error response"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "AccountId": {
        "name": "Account-ID",
        "in": "header",
        "required": true,
        "description": "Account identifier that specifies which account is making the request",
        "schema": {
          "type": "string",
          "example": "acc_123456"
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token passed as a Bearer token in the Authorization header"
      },
      "accountId": {
        "type": "apiKey",
        "in": "header",
        "name": "ACCOUNT-ID",
        "description": "Account ID required with bearer token"
      }
    }
  }
}