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

# Create Media

> Create a new media record with relationships to people, companies, or workspaces



## OpenAPI

````yaml POST /v1/medias
openapi: 3.1.0
info:
  title: Well Document API
  version: 1.0.0
  description: API for uploading and managing financial documents in the Well platform
servers:
  - url: https://api.wellapp.ai
security: []
paths:
  /v1/medias:
    post:
      summary: Create media
      description: >-
        Create a new media record with relationships to people, companies, or
        workspaces
      parameters:
        - $ref: '#/components/parameters/AuthorizationHeader'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MediaCreateRequestMultipart'
            example:
              file: '@/path/to/image.jpg'
              data: >-
                {"type":"media","attributes":{"media_type":"avatar","is_primary":true},"relationships":{"people":{"data":[{"type":"people","id":"550e8400-e29b-41d4-a716-446655440000"}]}}}
          application/json:
            schema:
              $ref: '#/components/schemas/MediaPost'
      responses:
        '201':
          description: Media created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaCreateResponse'
              example:
                data:
                  - type: media
                    id: media1
                    attributes:
                      media_type: avatar
                      url: https://cdn.example.com/avatar.jpg
                      is_primary: true
                      uploaded_at: '2025-06-01T10:00:00Z'
                      processed_at: '2025-06-01T10:00:00Z'
                    relationships:
                      people:
                        data:
                          - type: people
                            id: b6c22e98-c8d0-485e-9d3d-caa2bbaff77c
                      companies:
                        data:
                          - type: company
                            id: b6c22e98-c8d0-485e-9d3d-caa2bbaff77a
                      workspaces:
                        data:
                          - type: workspace
                            id: b6c22e98-c8d0-485e-9d3d-caa2bbaff77b
                    included:
                      - type: people
                        id: people1
                        attributes:
                          first_name: John
                          last_name: Doe
                          job_title: Software Engineer
                          created_at: '2025-05-01T09:00:00Z'
                          updated_at: '2025-06-01T10:00:00Z'
                      - type: company
                        id: b6c22e98-c8d0-485e-9d3d-caa2bbaff77a
                        attributes:
                          name: Tech Startup Inc
                          description: >-
                            An innovative technology company focused on AI and
                            ML solutions
                          registration_tax_id: '12345678901'
                          registration_registered_value: '123456789'
                          created_at: '2025-08-03T10:38:40.967Z'
                          updated_at: '2025-08-04T07:51:01.785Z'
                      - type: workspace
                        id: workspace_tenant
                        attributes:
                          name: Marketing Team Workspace
                          description: >-
                            Collaborative workspace for the marketing team to
                            manage campaigns and content
                          external_workspace_id: fygr_123
                          created_at: '2024-01-05T08:00:00Z'
                          updated_at: '2024-01-18T12:15:00Z'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
      description: Bearer token for authentication
  schemas:
    MediaCreateRequestMultipart:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: Image in png, jpg or svg format
        data.type:
          type: string
          const: media
          description: Resource type identifier
        data.attributes.media_type:
          type: string
          enum:
            - avatar
            - logo
            - banner
          description: Type of media (avatar, logo, banner)
        data.attributes.is_primary:
          type: boolean
          default: true
          description: 'Marks preferred media. Default: true'
        data.relationships.people.data[].type:
          type: string
          const: people
          description: Type for people relationship
        data.relationships.people.data[].id:
          type: string
          format: uuid
          description: UUID of the person to associate with this media
        data.relationships.companies.data[].type:
          type: string
          const: company
          description: Type for company relationship
        data.relationships.companies.data[].id:
          type: string
          format: uuid
          description: UUID of the company to associate with this media
        data.relationships.workspaces.data[].type:
          type: string
          const: workspace
          description: Type for workspace relationship
        data.relationships.workspaces.data[].id:
          type: string
          format: uuid
          description: UUID of the workspace to associate with this media
        data.relationships.workspaces.data[].external_workspace_id:
          type: string
          format: uuid
          description: UUID of the external workspace to associate with this media
      required:
        - file
        - data.type
    MediaPost:
      type: object
      properties:
        type:
          type: string
          const:
            - medias
          examples:
            - medias
        attributes:
          $ref: '#/components/schemas/MediaAttributesJson'
        relationship:
          type: object
          properties:
            persons:
              $ref: '#/components/schemas/PersonRelationRequest'
            companies:
              $ref: '#/components/schemas/CompanyRelationRequest'
            workspaces:
              $ref: '#/components/schemas/WorkspaceRelationRequest'
            invoice_items:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        const: invoice_item
                      id:
                        type: string
                        example: pm_1
                        description: >-
                          UUID of an existing invoice item or temp-id that
                          references an invoice item defined in the included
                          array
              description: Line items included in the invoice
    MediaCreateResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              const: media
            id:
              type: string
              format: uuid
            attributes:
              $ref: '#/components/schemas/MediaAttributes'
            relationships:
              $ref: '#/components/schemas/MediaResponseRelationships'
            included:
              $ref: '#/components/schemas/MediaResponseIncluded'
    BadRequestError:
      type: object
      properties:
        code:
          type: string
          example: SCHEMA_VALIDATION_ERROR
          description: Error code identifier
        status:
          type: integer
          example: 400
          description: HTTP status code
        title:
          type: string
          example: Validation Error
          description: Error title
        message:
          type: string
          example: The request is invalid
          description: Detailed error message
        details:
          type: array
          items:
            type: object
            properties:
              instancePath:
                type: string
                description: Path to the invalid field in the request
              schemaPath:
                type: string
                description: Path to the validation rule in the schema
              keyword:
                type: string
                description: Validation keyword that failed
              params:
                type: object
                description: Parameters related to the validation failure
              message:
                type: string
                description: Human-readable validation error message
          description: Array of detailed validation errors
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    UnauthorizedError:
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
          description: Error code identifier
        status:
          type: integer
          example: 401
          description: HTTP status code
        title:
          type: string
          example: Unauthorized
          description: Error title
        message:
          type: string
          example: You are not authorized to access this resource
          description: Detailed error message
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    MediaAttributesJson:
      type: object
      properties:
        media_type:
          type: string
          enum:
            - avatar
            - logo
            - banner
          description: >-
            Type of media (avatar, logo, banner) See [Media type
            documentation](/enums/media) for complete list.
        is_primary:
          type: boolean
          default: true
          description: 'Marks preferred media. Default: true'
        url:
          type: string
          format: uri
          description: Direct media URL
          examples:
            - https://cdn.example.com/avatar.jpg
      required:
        - media_type
        - url
    PersonRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - people
              id:
                type: string
                description: >-
                  UUID of an existing people or temp-id that references an
                  people defined in the included array
            required:
              - type
              - id
    CompanyRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - company
              id:
                type: string
                description: >-
                  UUID of an existing companies or temp-id that references an
                  companies defined in the included array
            required:
              - type
              - id
    WorkspaceRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            oneOf:
              - properties:
                  type:
                    type: string
                    enum:
                      - workspace
                  external_workspace_id:
                    type: string
                    description: External workspace identifier
                required:
                  - type
                  - external_workspace_id
              - properties:
                  type:
                    type: string
                    enum:
                      - workspace
                  id:
                    type: string
                    format: uuid
                    description: >-
                      UUID of an existing workspace or temp-id that references
                      an workspace defined in the included array
                required:
                  - type
                  - id
    MediaAttributes:
      type: object
      properties:
        media_type:
          type: string
          enum:
            - avatar
            - logo
            - banner
        url:
          type: string
          format: uri
          description: URL to the media file
        is_primary:
          type: boolean
          description: Whether this is the primary media
        processed_at:
          type:
            - string
          format: date-time
          description: Timestamp when media processing completed
        uploaded_at:
          type: string
          format: date-time
    MediaResponseRelationships:
      type: object
      properties:
        people:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: people
                  id:
                    type: string
                    format: uuid
        companies:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: company
                  id:
                    type: string
                    format: uuid
        workspaces:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: workspace
                  id:
                    type: string
                    format: uuid
    MediaResponseIncluded:
      type: object
      properties:
        people:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: people
                  id:
                    type: string
                    format: uuid
                  attributes:
                    $ref: '#/components/schemas/PeopleAttributes'
        companies:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: company
                  id:
                    type: string
                    format: uuid
                  attributes:
                    $ref: '#/components/schemas/CompanyAttributes'
        workspaces:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: workspace
                  id:
                    type: string
                    format: uuid
                  attributes:
                    $ref: '#/components/schemas/WorkspaceAttributes'
        invoice_item:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: invoice_item
                  id:
                    type: string
                    format: uuid
                  attributes:
                    $ref: '#/components/schemas/InvoiceItemsAttributes'
    PeopleAttributes:
      type: object
      properties:
        first_name:
          type: string
          description: The person's first name
        last_name:
          type: string
          description: The person's last name
        full_name:
          type: string
          description: The person's full name (typically first_name + last_name)
        created_at:
          type: string
          format: date-time
          description: Timestamp when the person was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the person was last updated
      additionalProperties: false
    CompanyAttributes:
      type: object
      properties:
        description:
          type: string
        domain_name_primary_link_url:
          type: string
          format: url
          maxLength: 500
          description: >-
            The domain url from the website or email address of the company.
            Used as unique identifier in some cases.
          examples:
            - acme.com
        tax_id:
          type: object
          properties:
            value:
              description: Tax ID issued by local or national tax authority.
              type: string
              examples:
                - DE123456789
            type:
              description: >-
                Type of tax ID, useful for applying formatting and validation
                rules.
              type: string
              examples:
                - VAT
        registration:
          type: object
          properties:
            trade_name:
              description: Commercial or branding name (if different from registered name).
              type: string
              examples:
                - TechSol
            registered_name:
              description: Legal company name.
              type: string
              minLength: 1
              maxLength: 100
              examples:
                - Red Hat Inc.
        registration_number:
          type: object
          properties:
            business_type:
              description: Legal entity structure type.
              type: string
              examples:
                - GmbH
            value:
              description: Official company registration number.
              type: string
              examples:
                - HRB 123456
            registry_name:
              description: Name of the official registration body.
              type: string
              examples:
                - Handelsregister Berlin
            registry_country:
              description: Country of the registry authority. (string (ISO 3166-1 alpha-2))
              type: string
              examples:
                - DE
        workspace_id:
          type: string
          format: uuid
          description: UUID of the workspace associated with this company
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    WorkspaceAttributes:
      type: object
      properties:
        name:
          type: string
          description: Workspace name
        desription:
          type: string
          description: Workspace description
        external_workspace_id:
          type: string
          format: uuid
          description: external workspace id
        avatar_color:
          type: string
          format: colors
          description: Color of the avatar
        created_at:
          type: string
          format: date-time
          description: Timestamp when the workspace was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the workspace was last updated
    InvoiceItemsAttributes:
      type: object
      properties:
        line_id:
          type: string
          description: Line identifier within the invoice
          example: '1'
        sku:
          type: string
          description: Stock Keeping Unit identifier
          example: WM-1001
        name:
          type: string
          description: Product or service name
          example: Wireless Mouse
        description:
          type: string
          description: Detailed description of the item
          example: Ergonomic wireless mouse with USB receiver
        unit_price:
          type: number
          format: decimal
          minimum: 0
          description: Unit price in local currency
          example: 25
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: ISO 4217 currency code
          example: EUR
        unit:
          type: string
          description: Unit of measurement
          example: EA
        min_quantity:
          type: integer
          minimum: 0
          description: Minimum quantity allowed
          example: 1
        max_quantity:
          type: integer
          minimum: 1
          description: Maximum quantity allowed
          example: 500
        tax:
          type: object
          properties:
            rate:
              type: number
              format: decimal
              minimum: 0
              maximum: 100
              description: Tax rate as percentage
              example: 20
            category:
              type: string
              description: Tax category
              example: standard
            scheme:
              type: string
              description: Tax scheme identifier
              example: VAT
        period:
          type: object
          properties:
            start:
              type: string
              format: date
              description: Service period start date
              example: '2025-06-26'
            end:
              type: string
              format: date
              description: Service period end date
              example: '2025-06-27'
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
          example: '2025-05-11T13:42:12Z'
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2025-05-11T13:45:20Z'

````