{
  "openapi": "3.0.1",
  "info": {
    "title": "FirstPromoter Assets",
    "version": "1.0",
    "description": "Get available assets "
  },
  "servers": [
    {
      "url": "https://api.firstpromoter.com/api/v2/affiliate"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/assets": {
      "get": {
        "summary": "Get available assets",
        "description": "Returns all assets \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/assets`</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 asset"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the asset"
                      },
                      "allowed_campaign_ids": {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        },
                        "description": "List of allowed campaign IDs for the asset"
                      },
                      "details": {
                        "type": "object",
                        "properties": {
                          "file_format": {
                            "type": "string",
                            "description": "File format of the asset"
                          },
                          "file_size": {
                            "type": "integer",
                            "nullable": true,
                            "description": "File size of the asset"
                          },
                          "image_size": {
                            "type": "object",
                            "properties": {
                              "width": {
                                "type": "integer",
                                "nullable": true,
                                "description": "Width of the image"
                              },
                              "height": {
                                "type": "integer",
                                "nullable": true,
                                "description": "Height of the image"
                              }
                            },
                            "description": "Size of the image (if applicable)"
                          }
                        },
                        "description": "Details about the asset"
                      },
                      "content": {
                        "type": "string",
                        "nullable": true,
                        "description": "Content of the asset"
                      },
                      "landing_page_url": {
                        "type": "string",
                        "nullable": true,
                        "description": "Landing page URL associated with the asset"
                      },
                      "asset_type": {
                        "type": "string",
                        "description": "Type of the asset (e.g., document, image)"
                      },
                      "url": {
                        "type": "string",
                        "description": "URL of the asset"
                      },
                      "thumbnail_url": {
                        "type": "string",
                        "nullable": true,
                        "description": "URL of the thumbnail image (if applicable)"
                      },
                      "uploading": {
                        "type": "boolean",
                        "description": "Indicates if the asset is currently being uploaded"
                      },
                      "category": {
                        "type": "string",
                        "nullable": true,
                        "description": "Category of the asset"
                      },
                      "allowed_campaigns": {
                        "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": "Allowed campaigns for the asset"
                        },
                        "description": "List of allowed campaigns for the asset"
                      }
                    },
                    "description": "Asset 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"
                }
              }
            }
          }
        }
      }
    },
    "/asset_categories": {
      "get": {
        "summary": "Get available asset categories",
        "description": "Returns all asset categories \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/asset_categories`</Tip>",
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountId"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    }
  },
  "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"
      }
    }
  }
}