openapi: 3.2.0
info:
title: Firstpromoter Assets API
version: '1.0'
description: 'Operations tagged Assets across 2 of this provider''s published API definitions: firstpromoter-v2-affiliate-assets-openapi.yml, firstpromoter-v2-assets-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.firstpromoter.com/api/v2/affiliate
- url: https://api.firstpromoter.com/api/v2/company
security:
- BearerAuth: []
tags:
- name: Assets
paths:
/assets:
get:
summary: Get available assets
description: "Returns all assets \n **HTTP Request**
` GET https://api.firstpromoter.com/api/v2/affiliate/assets`"
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
- 'null'
description: File size of the asset
image_size:
type: object
properties:
width:
type:
- integer
- 'null'
description: Width of the image
height:
type:
- integer
- 'null'
description: Height of the image
description: Size of the image (if applicable)
description: Details about the asset
content:
type:
- string
- 'null'
description: Content of the asset
landing_page_url:
type:
- string
- 'null'
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
- 'null'
description: URL of the thumbnail image (if applicable)
uploading:
type: boolean
description: Indicates if the asset is currently being uploaded
category:
type:
- string
- 'null'
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
- 'null'
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
tags:
- Assets
post:
summary: Create assets
description: "Create assets \n **HTTP Request**
`POST https://api.firstpromoter.com/api/v2/company/assets`"
tags:
- Assets
parameters:
- $ref: '#/components/parameters/AccountId'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
- asset_type
properties:
name:
type: string
description: Name of the asset
asset_type:
type: string
enum:
- image
- document
- link
- text
description: Type of the asset
file:
type: string
format: binary
description: File of the asset if asset_type is image or document
url:
type: string
description: URL of the asset
category_id:
type: integer
description: ID of the category
allowed_campaign_ids:
type: array
items:
type: integer
description: Array of allowed campaign IDs
content:
type: string
description: Content. Required for email and social media asset types
landing_page_url:
type: string
description: Landing page url. Optional for social media asset types
responses:
'200':
description: Asset created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: https://api.firstpromoter.com/api/v2/affiliate
/assets/{id}:
get:
summary: Get asset
description: "Get asset details \n **HTTP Request**
`GET https://api.firstpromoter.com/api/v2/company/assets/{id}`"
tags:
- Assets
parameters:
- $ref: '#/components/parameters/AccountId'
- name: id
in: path
required: true
description: ID of the asset
schema:
type: integer
responses:
'200':
description: Asset details
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
'401':
description: Unauthorized
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
summary: Update asset
tags:
- Assets
description: " Update an asset \n **HTTP Request**
`PUT https://api.firstpromoter.com/api/v2/company/assets/{id}`"
parameters:
- $ref: '#/components/parameters/AccountId'
- name: id
in: path
required: true
description: ID of the asset to be updated
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Name of the asset
asset_type:
type: string
enum:
- image
- document
- link
- text
description: Type of the asset
file:
type: string
format: binary
description: File of the asset if asset_type is image or document
url:
type: string
description: URL of the asset
category_id:
type: integer
description: ID of the category
allowed_campaign_ids:
type: array
items:
type: integer
description: Array of allowed campaign IDs
content:
type: string
description: Content. Required for email and social media asset types
landing_page_url:
type: string
description: Landing page url. Optional for social media asset types
responses:
'200':
description: Asset updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
'401':
description: Unauthorized
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: https://api.firstpromoter.com/api/v2/company
/assets/update_category:
put:
summary: Update category of an asset
description: "Update category of an asset \n **HTTP Request**
`PUT https://api.firstpromoter.com/api/v2/company/assets/update_category`"
tags:
- Assets
parameters:
- $ref: '#/components/parameters/AccountId'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- category_id
properties:
ids:
type: array
items:
type: integer
description: Array of asset ids
category_id:
type: integer
description: ID of the category. If null, category will be removed
responses:
'200':
description: Operation completed
content:
application/json:
schema:
$ref: '#/components/schemas/BatchOperationResult'
'202':
description: Operation accepted
content:
application/json:
schema:
$ref: '#/components/schemas/BatchOperationResult'
'401':
description: Unauthorized
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: https://api.firstpromoter.com/api/v2/company
/assets/destroy:
delete:
summary: Delete assets
description: "Delete assets \n **HTTP Request**
`DELETE https://api.firstpromoter.com/api/v2/company/assets/destroy`"
tags:
- Assets
parameters:
- $ref: '#/components/parameters/AccountId'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
ids:
type: array
items:
type: integer
description: Selected ids of assets to delete
responses:
'200':
description: Operation completed
content:
application/json:
schema:
$ref: '#/components/schemas/BatchOperationResult'
'202':
description: Operation accepted
content:
application/json:
schema:
$ref: '#/components/schemas/BatchOperationResult'
'401':
description: Unauthorized
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: https://api.firstpromoter.com/api/v2/company
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
schemas:
Asset:
type: object
properties:
id:
type: integer
name:
type: string
allowed_campaign_ids:
type: array
items:
type: integer
details:
type: object
properties:
file_format:
type: string
file_size:
type: integer
image_size:
type: object
properties:
width:
type: integer
height:
type: integer
content:
type: string
landing_page_url:
type: string
asset_type:
type: string
enum:
- image
- document
- link
- text
url:
type: string
thumbnail_url:
type: string
uploading:
type: boolean
category:
type: object
properties:
id:
type: integer
name:
type: string
position:
type: integer
allowed_campaigns:
type: array
items:
type: object
properties:
id:
type: integer
name:
type: string
color:
type: string
Error:
type: object
properties:
message:
type: string
code:
type: string
errors:
type: object
additionalProperties:
type: array
items:
type: string
BatchOperationResult:
type: object
properties:
id:
type: integer
status:
type: string
enum:
- pending
- completed
total:
type: integer
selected_total:
type: integer
processed_count:
type: integer
failed_count:
type: integer
action_label:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
meta:
type: object
progress:
type: integer
processing_errors:
type: array
items:
type: string
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
x-refined-from:
- firstpromoter-v2-affiliate-assets-openapi.yml
- firstpromoter-v2-assets-openapi.yml