Creatopy Public API
  • Public API
    • Quickstart
    • Authentication
  • REST API
    • Overview
    • Auth
    • Exports
      • Creatives
    • Templates (Designs)
      • Elements
      • Template Sizes
      • Font variants
    • ShareLink
    • Projects
      • Project Users
    • Brand Kits
      • Brand kit assets
      • Brand kit logos
      • Brand kit media folders
      • Brand templates
    • Ad Networks
    • Ad Serving
    • Users
      • Team roles
    • Webhooks
      • Webhook action types
    • Design Versions
    • Folders
      • Move design to folder
    • Error codes
    • Designs
  • GraphQL API
    • Overview
    • Endpoints and queries
    • Postman Collection
Powered by GitBook
On this page
  • Export Templates
  • Request
  • Response
  • Export existing design
  • Request
  • Response
  • Check Export Status
  • Request
  • Response
  1. REST API

Exports

Export Templates

This endpoint allows you to export templates by making an HTTP POST request. This endpoint will also create a new design with the requested element changes.

Request

  • Method: POST

  • Endpoint: https://api.creatopy.com/v1/export-with-changes

  • Body:

    • templateHash (string, required): The hash of the creative.

    • type (string, required): The type of export.

    • exportSettings (object, optional): Settings for the export

      • quality (integer, optional): HTML specific param. (Accepted values are in the range from 1 to 100).

            60 = LOW,
            80 = MEDIUM,
            90 = HIGH,
            100 = UNCOMPRESSED,
            Any other value is a custom value
      • gifPreset (string, optional): GIF specific param. Available values: ('highQuality', 'optimized', 'static').

      • networkId (integer, optional): HTML specific param.

      • pdfPreset (enum, optional): PDF specific param (PDF_STANDARD and PDF_PRINT)

      • slide (array of integer, optional): PDF specific param (the slide number to export, starts from 0 (for the first slide))

      • scale: (float, optional): JPG, WEBP, PNG specific param.

      • targetFPS: (integer, optional): frame rate - MP4 specific param

      • retina (boolean, optional): save retina-specific images - HTML specific param

      • retinaOnly (boolean, optional): exclude non-retina images from downloaded zip - HTML specific param

      • convertCustomFonts (boolean, optional): convert custom fonts to SVG - HTML specific param

      • minifyHtml (boolean, optional): minify HTML size - HTML specific param

      • urlTarget (enum, optional): HTML specific param (_blank, _self, _top, _parent )

      • useAsClickTag (boolean, optional): HTML specific param

      • clickTagUrl (string, optional): HTML specific param

      • includeFallbackImage (boolean, optional): include a .jpg format fallback image into downloaded zip HTML specific param

    • webhookUrl (string, optional): Webhook URL that will be called when the export completes (succeed or fails)

    • elementsChanges (array, required):

      • elementName (string, required): The name of the element.

      • changes (array of objects, required):

        • attribute (string, required): The attribute to be changed. (Available attributes are: "LABEL", "SOURCE", "CODE", "VISIBILITY", "FONTVARIANT", "TEXTMARKDOWN", "TEXTCOLOR", "BGCOLOR", "SVGCOLORS", "LINEHEIGHT" and "LETTERSPACING")

        • value (string, required): The new value for the attribute.

    • generalChanges (object, optional):

      • backgroundColor (string, optional): Any valid hexadecimal color code. The valid hexadecimal color code must satisfy the following conditions. It should start from '#' symbol. It should be followed by the letters from a-f, A-F and/or digits from 0-9. The length of the hexadecimal color code should be either 6 or 3, excluding '#' symbol

    • generalSettings (object, optional):

      • newDesignProjectId (integer, optional): The id of the project where the new generated design will be saved.

      • newDesignFolderId (integer, optional): The id of the folder, where the new generated design will be saved. (if not provided, the new design will be created on the root of the provided project)

      • newDesignName (string, optional): The name of the new generated design. Also, this name will be included in the name of the downloaded version of the creatives. (Also the name will be the name of the zipped version of the downloadable urls of a design set - known as zipUrl in the response for design set)

Valid values for elementChanges are (depending on attribute):

  • LABEL: any valid string

  • SOURCE: any valid public media file link (also Google Drive and Dropbox shared links)

  • CODE: valid embed code

  • VISIBILITY: 'true' or 'false' (as string)

  • FONTVARIANT: any existing font weight value from the result of the endpoint templates/fontVariants for ex: '300italic' , '400', '700italic', etc.

  • TEXTMARKDOWN: 4 markdowns could be added to text elements

    • Link - [This is the text](This will be the link)

    • Italic text - text between one star - (* will be transformed as italic text *)

    • Bold text - text between two pair of stars - (** will be transformed as bold text **)

    • Bold italic text - text between two group of three stars - (*** will be bold and italic text ***)

  • TEXTCOLOR: valid hexadecimal color code (#FFF or #FFFFFF) - used with TEXT and BUTTON layers

  • BGCOLOR: valid hexadecimal color code (#FFF or #FFFFFF) - used for changing background for BUTTON or SHAPE layers

  • SVGCOLORS: valid hexadecimal color list ("#123456", "#FFFFFF", "#AAAAAA") - used for layers which has svg file as source

  • LINEHEIGHT - used with TEXT layers

  • LETTERSPACING - used with TEXT and BUTTON layers

IMPORTANT!!

If you use a request in which the input is exactly the same as another input used earlier and the request status was 'complete', the response will be the cached result of the other's request.

curl --location 'https://api.creatopy.com/v1/export-with-changes' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ...' \
--data '{
    "templateHash": "zdow6r",
    "type": "jpg",
    "elementsChanges": [
        {
            "elementName": "Headline",
            "changes": [
                {
                    "attribute": "LABEL",
                    "value": "Enjoy a $0 annual \nfee and 1.5% \n cashback on purchases"
                }
            ]
        },
        {
            "elementName": "Description",
            "changes": [
                {
                    "attribute": "LABEL",
                    "value": "Plus, earn a $300 bonus"
                },
                {
                    "attribute": "VISIBILITY",
                    "value": "false"
                },
                {
                    "attribute": "FONTVARIANT",
                    "value": "400italic"
                }
            ]
        },
        {
            "elementName": "Logo",
            "changes": [
                {
                    "attribute": "SOURCE",
                    "value": "https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/eff.svg"
                }
            ]
        },
        {
            "elementName": "shape2",
            "changes": [
                {
                    "attribute": "SOURCE",
                    "value": "https://cdn.pixabay.com/photo/2012/04/24/16/43/targets-40383_1280.png"
                }
            ]
        },
        {
            "elementName": "Image",
            "changes": [
                {
                    "attribute": "SOURCE",
                    "value": "https://cdn.pixabay.com/photo/2012/04/24/16/43/targets-40383_1280.png"
                }
            ]
        }
    ]
}'

Response

The response to this request is a JSON schema:

Response example
{
    "response": {
        "export": {
            "id": "b46adaed-39df-41a2-89e5-beb870282414", 
            "type": "jpg",
            "status": "pending",
            "errorLog": null,
            "creatives": [
                {
                    "id": "fc188412-c614-4db7-b611-f725e73cb36d",
                    "status": "pending",
                    "url": null
                },
                {
                    "id": "954dad76-6dd9-4a79-ac09-26da6bceeb96",
                    "status": "pending",
                    "url": null
                }
            ]
        }
    }
}

With the export ID we will check the status of the export

Export existing design

This endpoint allows you to export existing designs by making an HTTP POST request. This endpoint will not create a new design.

Request

  • Method: POST

  • Endpoint: https://api.creatopy.com/v1/export

  • Body:

    • creativeHash (string, required): The hash of the creative.

    • type (string, required): The type of export.

    • exportSettings (object, optional): Settings for the export

      • quality (integer, optional): HTML specific param.

      • gifPreset (enum, optional): GIF specific param.

      • networkId (integer, optional): HTML specific param.

      • pdfPreset (enum, optional): Pdf specific param (PDF_STANDARD and PDF_PRINT)

      • slide (array of integer, optional): PDF specific param (the slide number to export, starts from 0 (for the first slide)

      • retinaOnly (boolean, optional): exclude non-retina images from downloaded zip - HTML specific param

      • convertCustomFonts (boolean, optional): convert custom fonts to SVG - HTML specific param

      • minifyHtml (boolean, optional): minify HTML size - HTML specific param

      • urlTarget (enum, optional): HTML specific param (_blank, _self, _top, _parent )

      • useAsClickTag (boolean, optional): HTML specific param

      • clickTagUrl (string, optional): HTML specific param

      • includeFallbackImage (boolean, optional): include a .jpg format fallback image into downloaded zip HTML specific param

    • webhookUrl (string, optional): Webhook URL that will be called when the export completes (succeed or fails)

curl --location 'https://api.creatopy.com/v1/export' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ...' \
--data '{
    "creativeHash": "zdow6r",
    "type": "jpg",
}'

Response

The response to this request is a JSON schema:

Response example
{
    "response": {
        "export": {
            "id": "b46adaed-39df-41a2-89e5-beb870282414", 
            "type": "jpg",
            "status": "pending",
            "errorLog": null,
            "creatives": [
                {
                    "id": "fc188412-c614-4db7-b611-f725e73cb36d",
                    "status": "pending",
                    "url": null
                },
                {
                    "id": "954dad76-6dd9-4a79-ac09-26da6bceeb96",
                    "status": "pending",
                    "url": null
                }
            ]
        }
    }
}

With the export ID, we will check the status of the export

For design sets we added a possibility to download all creatives from a single link. You will find the link in the response at zipUrl field.

Check Export Status

This endpoint retrieves the export data with the specified ID.

Request

  • Method: GET

  • URL: https://api.creatopy.com/v1/export/b46adaed-39df-41a2-89e5-beb870282414

Response

  • Status: 200

  • Content-Type: application/json

Response example
{
    "response": {
        "id": "b46adaed-39df-41a2-89e5-beb870282414",
        "type": "jpg",
        "status": "complete",
        "errorLog": null,
        "creatives": [
            {
                "status": "complete",
                "url": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/b46adaed-39df-41a2-89e5-beb870282414/fc188412-c614-4db7-b611-f725e73cb36d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20240911%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240911T072944Z&X-Amz-Expires=3600&X-Amz-Signature=6739d8a7f2f70b7a518c510eb10ebcbcd82fe57dec1a0c335df473257229562e&X-Amz-SignedHeaders=host",
                "id": "fc188412-c614-4db7-b611-f725e73cb36d"
            },
            {
                "status": "complete",
                "url": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/b46adaed-39df-41a2-89e5-beb870282414/954dad76-6dd9-4a79-ac09-26da6bceeb96?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20240911%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240911T072944Z&X-Amz-Expires=3600&X-Amz-Signature=bfd48ac7717f9f4cedf60aa5d3ca0f2dbf55ec202bf8ac9829465756450489ef&X-Amz-SignedHeaders=host",
                "id": "954dad76-6dd9-4a79-ac09-26da6bceeb96"
            }
        ]
    }
}
Response example for design set

{
    "response": {
        "id": "b46adaed-39df-41a2-89e5-beb870282414",
        "type": "jpg",
        "status": "complete",
        "errorLog": null,
        "creatives": [
            {
                "zipUrl": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/f4d71ed6-c10f-41ed-9704-434b021647aa/4a56079b-6107-4db9-9214-49fbc635f761?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20250410%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250410T130012Z&X-Amz-Expires=3600&X-Amz-Signature=6d5cb6d8a3133fa5b89529acc282e4367e5d747710bc6d945eac56a6fd9014f2&X-Amz-SignedHeaders=host",
                "creatives": [
                    {
                        "status": "complete",
                        "url": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/f4d71ed6-c10f-41ed-9704-434b021647aa/4a9c1246-4de8-4b70-b59f-6d9eeab13912?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20250410%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250410T130010Z&X-Amz-Expires=3600&X-Amz-Signature=c627d916ac8c4031d6f07a0310acd540bf02a8dfd2168a021db7e06eafbf58ff&X-Amz-SignedHeaders=host",
                        "id": "4a9c1246-4de8-4b70-b59f-6d9eeab13912",
                        "size": {
                            "name": "Large Rectangle",
                            "width": 336,
                            "height": 280,
                            "measureUnit": "px"
                        },
                        "slideNumber": null
                    },
                    {
                        "status": "complete",
                        "url": "https://creatopy-api-0d4e56b.s3.eu-central-1.amazonaws.com/creatives/f4d71ed6-c10f-41ed-9704-434b021647aa/662a743b-5976-4221-9808-eef7c70c4e60?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBL5EQ3KHE%2F20250410%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250410T130010Z&X-Amz-Expires=3600&X-Amz-Signature=bc4207873ae4a092d8d7ce1b67bd3db4bfd24ccf820f44f6f5b8aa417b08370d&X-Amz-SignedHeaders=host",
                        "id": "662a743b-5976-4221-9808-eef7c70c4e60",
                        "size": {
                            "name": "Netboard",
                            "width": 580,
                            "height": 400,
                            "measureUnit": "px"
                        },
                        "slideNumber": null
                    }
                ]
            }
        ]
    }
}
PreviousAuthNextCreatives

Last updated 24 days ago

Creatives