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

# Create Binding



## OpenAPI

````yaml post /bindings
openapi: 3.1.0
info:
  title: Pictify API
  version: 1.0.0
  description: |
    Generate images, GIFs, and PDFs from HTML templates programmatically.

    ## Authentication
    All API requests require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer pk_live_your_api_key
    ```

    ## Rate Limits
    - Free: 60 requests/minute
    - Pro: 300 requests/minute
    - Business: 1,000 requests/minute

    Rate limit headers are included in all responses.
  contact:
    email: support@pictify.io
    url: https://pictify.io
  license:
    name: MIT
servers:
  - url: https://api.pictify.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Images
    description: Image generation endpoints
  - name: GIFs
    description: GIF generation and capture
  - name: PDFs
    description: PDF generation
  - name: Templates
    description: Template management
  - name: Batch
    description: Batch rendering operations
  - name: Experiments
    description: A/B testing, smart links, and scheduled variant experiments
  - name: Webhooks
    description: Webhook subscription management
  - name: Bindings
    description: Data binding for auto-rendering
paths:
  /bindings:
    post:
      tags:
        - Bindings
      summary: Create a binding
      operationId: createBinding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - templateId
                - dataSource
                - mapping
              properties:
                templateId:
                  type: string
                name:
                  type: string
                dataSource:
                  type: object
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      enum:
                        - http
                        - webhook
                        - static
                    url:
                      type: string
                      format: uri
                    method:
                      type: string
                      enum:
                        - GET
                        - POST
                    headers:
                      type: object
                      additionalProperties:
                        type: string
                    credentials:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - api_key
                            - bearer_token
                            - basic_auth
                            - custom_header
                        value:
                          type: string
                mapping:
                  type: object
                  additionalProperties:
                    type: string
                defaults:
                  type: object
                refreshPolicy:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - ttl
                        - etag
                        - webhook
                        - manual
                    ttlSeconds:
                      type: integer
                    onError:
                      type: string
                      enum:
                        - serve_stale
                        - serve_error
                        - serve_default
                outputConfig:
                  type: object
                  properties:
                    format:
                      type: string
                      enum:
                        - png
                        - jpeg
                        - webp
                        - pdf
                    quality:
                      type: integer
      responses:
        '201':
          description: Binding created
          content:
            application/json:
              schema:
                type: object
                properties:
                  binding:
                    $ref: '#/components/schemas/Binding'
components:
  schemas:
    Binding:
      type: object
      properties:
        uid:
          type: string
        name:
          type: string
        templateId:
          type: string
        dataSource:
          type: object
          properties:
            type:
              type: string
              enum:
                - http
                - webhook
                - static
            url:
              type: string
              format: uri
            method:
              type: string
              enum:
                - GET
                - POST
        mapping:
          type: object
          additionalProperties:
            type: string
        defaults:
          type: object
          additionalProperties: true
        refreshPolicy:
          type: object
          properties:
            type:
              type: string
              enum:
                - ttl
                - etag
                - webhook
                - manual
            ttlSeconds:
              type: integer
            onError:
              type: string
              enum:
                - serve_stale
                - serve_error
                - serve_default
        status:
          type: string
          enum:
            - active
            - paused
            - error
        renderUrl:
          type: string
          format: uri
        webhookUrl:
          type: string
          format: uri
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the Pictify dashboard

````