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

# Create Contract

> Register a new distribution contract record for a token.



## OpenAPI

````yaml /apis/admin/openapi.json post /api/external/v1/contracts/create
openapi: 3.1.0
info:
  title: Magna Admin API
  version: 1.0.0
  description: >-
    The private, server-to-server API for managing allocations, funding and
    claims, transactions, portals, and token data. Authenticated with a project
    API key sent in the `x-magna-api-token` header.
servers:
  - url: https://app.magna.so
    description: Production
security:
  - apiToken: []
paths:
  /api/external/v1/contracts/create:
    post:
      tags:
        - Contracts
      summary: Create Contract
      description: Register a new distribution contract record for a token.
      operationId: postContractsCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type:
                - object
              properties:
                tokenId:
                  type:
                    - string
                  minLength: 1
                  format: uuid
                name:
                  type:
                    - string
                  minLength: 1
                contractType:
                  type:
                    - string
                  enum:
                    - AIRDROP_FACTORY
                    - TOKEN_FACTORY
                    - ORDER_MANAGER_FACTORY
                    - CUSTODY_FACTORY
                    - STAKING_FACTORY
                    - AIRLOCK
                    - AIRLOCK_MERKLE_VESTER
                    - AIRDROP
                    - ORDER_MANAGER
                    - CUSTODY
                    - STAKING
              required:
                - tokenId
                - contractType
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  isProcessed:
                    type: boolean
                  result:
                    description: Endpoint-specific result payload.
              example:
                isProcessed: true
                result:
                  id: c1...uuid
                  name: Main Vesting Contract
                  type: AIRLOCK
                  tokenId: tok...uuid
                  address: null
                  createdAt: '2024-04-15T21:26:21.000Z'
        '400':
          description: Validation error
        '401':
          description: Missing or invalid API token
        '403':
          description: API token lacks the required scope or project access
components:
  securitySchemes:
    apiToken:
      type: apiKey
      in: header
      name: x-magna-api-token

````