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

# Request document upload targets

> Returns one signed upload URL per PDF, markdown or text file for a brand kit you own.



## OpenAPI

````yaml openapi/magnific-api-v2-projects-openapi.yaml POST /v2/brand-kits/{brand_kit_id}/documents/uploads
openapi: 3.1.0
info:
  title: Magnific API v2 — Projects, uploads, generation, generations and library
  version: 2.0.0
  description: >-
    Projects and folders, uploads, image, video and audio generation,
    generations and the library of the Magnific API v2.
servers:
  - url: https://api.magnific.com
    description: Production V2
security:
  - magnificApiKey: []
  - bearerAuth: []
tags:
  - name: Projects
    description: >-
      Your projects and the folders inside them: list, create, rename, archive
      and delete them, and manage who has access.
  - name: Library
    description: >-
      Reusable characters, styles, products and locations to reference when you
      generate.
  - name: Videos
    description: >-
      Generate and edit videos. Add `?dry_run=true` to get the price of a
      request first.
  - name: Images
    description: Generate images and edit your image creations.
  - name: Creations
    description: >-
      What your generations, edits and uploads produced: read, list, rename,
      move, trash and download them.
  - name: Tags
    description: A project's review statuses and labels, and their assignment to creations.
  - name: Uploads
    description: >-
      Your own files as creations: upload them, import them from a URL, or save
      a stock item.
  - name: Flows
    description: >-
      Multi-step workflows saved from a Space: list them, read their inputs and
      run them.
  - name: Audio
    description: 'Generate and edit audio: voiceovers, music and sound effects.'
  - name: Brandkits
    description: >-
      Your brand kits: colours, fonts, logos, rules, documents and templates,
      and the creations made with them.
  - name: Search
    description: Search your creations across your workspace.
  - name: Account
    description: >-
      The account a request is paid with: its plan, available credits, profile
      and permissions.
paths:
  /v2/brand-kits/{brand_kit_id}/documents/uploads:
    post:
      tags:
        - Brandkits
      summary: Request document upload targets
      description: >-
        Returns one signed upload URL per PDF, markdown or text file for a brand
        kit you own. PUT each file to its

        `upload_url`, then add it with `POST
        /v2/brand-kits/{brand_kit_id}/documents`. Requires a paid plan.


        A personal token needs `api:write`.
      operationId: public-api.brandkits.documents.uploads
      parameters:
        - name: brand_kit_id
          in: path
          required: true
          description: The brand kit's `id`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBrandKitDocumentUploadsApiRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      kit_id:
                        type: string
                      uploads:
                        type: array
                        items:
                          type: object
                          properties:
                            filename:
                              type: string
                            type:
                              type: string
                              description: >-
                                The document type to register it with: `pdf`, or
                                `design_md` for markdown and text.
                            upload_url:
                              type: string
                              description: >-
                                PUT the file's raw bytes here with the
                                `Content-Type` of `mime_type`, before
                                `expires_at`.
                            upload_path:
                              type: string
                              description: >-
                                Send it as `upload_path` to `POST
                                /v2/brand-kits/{brand_kit_id}/documents` once
                                the upload succeeded.
                            mime_type:
                              type: string
                            max_bytes:
                              type: integer
                            expires_at:
                              type: string
                          required:
                            - filename
                            - type
                            - upload_url
                            - upload_path
                            - mime_type
                            - max_bytes
                            - expires_at
                    required:
                      - kit_id
                      - uploads
                required:
                  - data
        '401':
          description: >-
            `unauthenticated`: the token or API key is missing, expired or
            invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
        '403':
          description: >-
            `forbidden`, or a more specific code such as `insufficient_scope`:
            your token, role, plan or organization does not allow it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                      required_scope:
                        type: string
                        description: 'For `insufficient_scope`: the scope the token needs.'
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
        '404':
          description: '`not_found`: it does not exist, or you cannot see it.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
        '422':
          description: >-
            `validation_failed`: `details.errors` lists the problems by field.
            `unsupported_by_model`: `details.violations` lists the values the
            model does not accept.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
        '429':
          description: >-
            `rate_limited`, or the limit reached, such as
            `upload_quota_exceeded`. Retry after the `Retry-After` header, in
            seconds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
        '500':
          description: >-
            `server_error`: an unexpected error. Share `request_id` with
            support.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
        '503':
          description: >-
            `service_unavailable`: temporarily unavailable. Retry after the
            `Retry-After` header, in seconds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      A stable error code, such as `validation_failed`,
                      `insufficient_credits`, `not_found` or `rate_limited`.
                    examples:
                      - validation_failed
                  message:
                    type: string
                    description: A human-readable message.
                  details:
                    type: object
                    description: More detail about the error, when there is any.
                    properties:
                      errors:
                        type: object
                        description: >-
                          Validation messages by field, such as `resolution`;
                          under `request` for the request as a whole.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      violations:
                        type: array
                        description: >-
                          Each value the model does not accept, with the values
                          it accepts.
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              description: The model slug.
                            field:
                              type: string
                              description: >-
                                The field: `resolution`, `aspect_ratio`,
                                `duration`, `multi_prompt`, `references`...
                            message:
                              type: string
                            allowed:
                              type: array
                              description: The values the model takes, when it lists them.
                              items:
                                type: string
                            max:
                              type: number
                              description: The highest value the model takes, for a limit.
                          required:
                            - model
                            - field
                            - message
                  request_id:
                    type: string
                    description: The request id, to share with support.
                required:
                  - code
                  - message
      security:
        - magnificApiKey: []
        - bearerAuth: []
components:
  schemas:
    RequestBrandKitDocumentUploadsApiRequest:
      type: object
      properties:
        files:
          type: array
          description: One entry per file, up to the per-request limit.
          items:
            type: object
            properties:
              filename:
                type: string
                description: 'The file''s name with its extension: .pdf, .md or .txt.'
                pattern: \.(pdf|md|txt)$
                maxLength: 255
            required:
              - filename
          minItems: 1
          maxItems: 10
      required:
        - files
      title: RequestBrandKitDocumentUploadsApiRequest
  securitySchemes:
    magnificApiKey:
      type: apiKey
      in: header
      name: x-magnific-api-key
      description: >-
        Your Magnific API key. [Learn how to obtain an API
        key](https://docs.magnific.com/quickstart)
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A personal access token, sent as `Authorization: Bearer <token>`. [How
        to get one](/api-reference/v2/overview#get-a-personal-access-token)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.