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

# Create a third-party resource

> Creates a link to a resource hosted outside the community. The resource is identified by its third-party reference. Tags are matched by name against existing child tags



## OpenAPI

````yaml https://api.zapnito.com/api/docs/v1/swagger.json post /api/v1/third_party_resources
openapi: 3.0.1
info:
  title: API V1
  version: v1
  description: Zapnito API Documentation
servers:
  - url: https://{host}
    description: Your community domain
    variables:
      host:
        default: your-community.com
        description: Your community domain, for example your-community.com
security: []
tags:
  - name: Health Check
    description: Check that the API is reachable and that your API key is valid
  - name: Identity
    description: Find out which community your API key belongs to
  - name: Users
    description: >-
      Look up the people in your community, update their profile and choose
      which notifications they receive
  - name: Organisations
    description: >-
      Create and update the organisations in your community and manage who
      belongs to them
  - name: Groups
    description: Create groups and manage which users belong to them
  - name: Invitations
    description: Invite people to join your community
  - name: Posts
    description: Create, read and update posts on behalf of your community members
  - name: Contents
    description: >-
      Read the published content of your community and publish, schedule or
      unpublish it
  - name: Channels
    description: List the channels in your community and the content published in each
  - name: Rooms
    description: Create and read the rooms where your community members meet
  - name: Tags
    description: Create tags and apply them to content
  - name: Badges
    description: Create badges and award them to content or to users
  - name: Custom Fields
    description: Read the custom profile fields your community asks its members to fill in
  - name: Third-Party Resources
    description: >-
      Link to resources hosted outside your community so they appear alongside
      your content
  - name: Rest Hooks
    description: >-
      Subscribe a URL to events in your community, so you are told when they
      happen
paths:
  /api/v1/third_party_resources:
    post:
      tags:
        - Third-Party Resources
      summary: Create a third-party resource
      description: >-
        Creates a link to a resource hosted outside the community. The resource
        is identified by its third-party reference. Tags are matched by name
        against existing child tags
      operationId: createThirdPartyResource
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThirdPartyResourceCreateRequest'
            examples:
              new_resource:
                summary: A resource with its reference, title and URL
                value:
                  third_party_resource:
                    third_party_ref: ABC123
                    title: External guidance document
                    canonical_url: https://example.com/resource
        required: true
        description: Resource payload wrapped in a third_party_resource object
      responses:
        '200':
          description: The third-party resource was created
          content:
            application/json:
              examples:
                example:
                  value:
                    third_party_resource:
                      id: 1
                      third_party_ref: ABC123
                      title: External guidance document
                      description: A useful external resource
                      canonical_url: https://example.com/resource
                      thumbnail_url: https://example.com/thumbnail.png
                      open_in_new_tab: false
                      published_at: '2024-01-01T00:00:00Z'
                      category: Guidance
                      tags:
                        - clinical
              schema:
                type: object
                properties:
                  third_party_resource:
                    $ref: '#/components/schemas/ThirdPartyResource'
                required:
                  - third_party_resource
        '401':
          description: >-
            The API key is missing or invalid. The response body is the text
            `HTTP Token: Access denied.`
        '422':
          description: The request failed validation
          content:
            application/json:
              examples:
                error:
                  value:
                    errors:
                      title:
                        - can't be blank
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      title:
                        type: array
                        items:
                          type: string
                        example:
                          - can't be blank
                required:
                  - errors
      security:
        - tokenAuth: []
components:
  schemas:
    ThirdPartyResourceCreateRequest:
      type: object
      properties:
        third_party_resource:
          type: object
          properties:
            third_party_ref:
              type: string
              example: ABC123
            title:
              type: string
              example: External guidance document
            description:
              type: string
              example: A useful external resource
            canonical_url:
              type: string
              example: https://example.com/resource
            thumbnail_url:
              type: string
              example: https://example.com/thumbnail.png
            open_in_new_tab:
              type: boolean
              example: false
            published_at:
              type: string
              format: date-time
              example: '2024-01-01T00:00:00Z'
            category_name:
              type: string
              example: Guidance
              description: >-
                Name of the category for the resource. The category is created
                if it does not exist
            tags:
              type: array
              items:
                type: string
              example:
                - clinical
              description: >-
                Names of existing child tags to apply to the resource
                (case-insensitive)
          required:
            - third_party_ref
            - title
            - canonical_url
      required:
        - third_party_resource
    ThirdPartyResource:
      type: object
      properties:
        id:
          type: integer
          example: 1
        third_party_ref:
          type: string
          example: ABC123
          description: >-
            Your own reference for the resource. Identifies it in the URLs of
            this API
        title:
          type: string
          example: External guidance document
        description:
          type: string
          nullable: true
          example: A useful external resource
        canonical_url:
          type: string
          example: https://example.com/resource
        thumbnail_url:
          type: string
          nullable: true
          example: https://example.com/thumbnail.png
        open_in_new_tab:
          type: boolean
          example: false
          description: Whether the resource opens in a new browser tab
        published_at:
          type: string
          nullable: true
          format: date-time
          example: '2024-01-01T00:00:00Z'
        category:
          type: string
          nullable: true
          example: Guidance
          description: Name of the category the resource is in
        tags:
          type: array
          items:
            type: string
          example:
            - clinical
          description: Names of the tags applied to the resource
      required:
        - id
        - third_party_ref
        - title
        - canonical_url
        - open_in_new_tab
        - tags
  securitySchemes:
    tokenAuth:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        API authentication using your community API secret. The value below is
        sent as the Authorization header verbatim, so paste the whole header
        value including the prefix: Token token=<api-key>
      x-default: Token token=<api-key>

````

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