> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.bannerify.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create pdf

Use this endpoint to create a pdf file from a template.


## OpenAPI

````yaml post /v1/templates/createPdf
openapi: 3.0.0
info:
  title: Bannerify API
  version: 0.0.0
servers:
  - url: https://api.bannerify.co
    description: Production
security:
  - token: []
paths:
  /v1/templates/createPdf:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                apiKey:
                  type: string
                templateId:
                  type: string
                  description: Your template ID
                  example: tpl_xxx
                modifications:
                  anyOf:
                    - type: array
                      items:
                        $ref: '#/components/schemas/Modification'
                    - type: object
                      additionalProperties:
                        nullable: true
                    - type: string
                    - nullable: true
                    - nullable: true
                  default: []
                  description: >-
                    Template modifications as the API array format, an object
                    shorthand, or a JSON string. Object values map to text by
                    default, while nested objects keep fields such as src,
                    qrcode, rows, or chart.
                  example:
                    headline: Summer sale
                    photo:
                      src: https://example.com/photo.png
              required:
                - apiKey
                - templateId
      responses:
        '200':
          description: Success create pdf
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: The binary of pdf file
        '400':
          description: >-
            The server cannot or will not process the request due to something
            that is perceived to be a client error (e.g., malformed request
            syntax, invalid request message framing, or deceptive request
            routing).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrBadRequest'
                  - $ref: '#/components/schemas/ErrFetchImageError'
        '401':
          description: >-
            Although the HTTP standard specifies "unauthorized", semantically
            this response means "unauthenticated". That is, the client must
            authenticate itself to get the requested response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
        '403':
          description: >-
            The client does not have access rights to the content; that is, it
            is unauthorized, so the server is refusing to give the requested
            resource. Unlike 401 Unauthorized, the client's identity is known to
            the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrForbidden'
        '404':
          description: >-
            The server cannot find the requested resource. In the browser, this
            means the URL is not recognized. In an API, this can also mean that
            the endpoint is valid but the resource itself does not exist.
            Servers may also send this response instead of 403 Forbidden to hide
            the existence of a resource from an unauthorized client. This
            response code is probably the most well known due to its frequent
            occurrence on the web.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
        '409':
          description: >-
            This response is sent when a request conflicts with the current
            state of the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrConflict'
        '429':
          description: >-
            The user has sent too many requests in a given amount of time ("rate
            limiting")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrTooManyRequests'
        '500':
          description: >-
            The server has encountered a situation it does not know how to
            handle.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrInternalServerError'
components:
  schemas:
    Modification:
      type: object
      properties:
        name:
          type: string
          description: The layer name of the modification
          example: Text 1
        color:
          type: string
          description: The color for the modification
          example: '#FF0000'
        src:
          type: string
          description: The source image for the modification
          example: https://example.com/image.jpg
        text:
          type: string
          description: You can modify the text layer with this field
          example: Hello World
        barcode:
          type: string
          description: Modify the barcode layer content with this field
          example: '1234567890'
        qrcode:
          type: string
          description: Modify the qrcode layer content with this field
          example: Some text
        chart:
          type: object
          additionalProperties:
            nullable: true
          description: Update chart layer's data, follow chart.js data structure
        visible:
          type: boolean
          description: Set the visibility of the field
          example: true
        star:
          type: number
          description: Star value
          example: 5
        widthMode:
          type: string
          enum:
            - standard
            - adaptive
          description: Table width mode
          example: adaptive
        heightMode:
          type: string
          enum:
            - standard
            - adaptive
          description: Table height mode
          example: adaptive
        theme:
          type: string
          enum:
            - NONE
            - DEFAULT
            - BRIGHT
            - SIMPLIFY
            - ARCO
          description: Table theme
          example: NONE
        rows:
          type: array
          items:
            nullable: true
          description: Table rows
        columns:
          type: array
          items:
            type: string
          description: Table columns
      required:
        - name
      description: A modification (aka override) to apply to the layer in image
    ErrBadRequest:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
              description: A machine readable error code.
              example: BAD_REQUEST
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://bannerify.co/docs/api-reference/errors/code/BAD_REQUEST
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrFetchImageError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - FETCH_IMAGE_ERROR
              description: A machine readable error code.
              example: FETCH_IMAGE_ERROR
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://bannerify.co/docs/api-reference/errors/code/FETCH_IMAGE_ERROR
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrUnauthorized:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
              description: A machine readable error code.
              example: UNAUTHORIZED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://bannerify.co/docs/api-reference/errors/code/UNAUTHORIZED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrForbidden:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - FORBIDDEN
              description: A machine readable error code.
              example: FORBIDDEN
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://bannerify.co/docs/api-reference/errors/code/FORBIDDEN
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - NOT_FOUND
              description: A machine readable error code.
              example: NOT_FOUND
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://bannerify.co/docs/api-reference/errors/code/NOT_FOUND
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrConflict:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - CONFLICT
              description: A machine readable error code.
              example: CONFLICT
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://bannerify.co/docs/api-reference/errors/code/CONFLICT
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrTooManyRequests:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - TOO_MANY_REQUESTS
              description: A machine readable error code.
              example: TOO_MANY_REQUESTS
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://bannerify.co/docs/api-reference/errors/code/TOO_MANY_REQUESTS
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrInternalServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INTERNAL_SERVER_ERROR
              description: A machine readable error code.
              example: INTERNAL_SERVER_ERROR
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://bannerify.co/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req:1234
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
  securitySchemes:
    token:
      type: apiKey
      in: query
      name: apiKey
      x-speakeasy-example: BANNERIFY_API_KEY

````