> ## 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.

# Tag content

> Applies an existing tag to one or more items of content. Content is identified by its URL, its slug, or both. Identifiers that match no content are ignored, as long as at least one matches. The tag is matched by name (case-insensitive)



## OpenAPI

````yaml https://api.zapnito.com/api/docs/v1/swagger.json put /api/v1/tags/contents
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/tags/contents:
    put:
      tags:
        - Tags
      summary: Tag content
      description: >-
        Applies an existing tag to one or more items of content. Content is
        identified by its URL, its slug, or both. Identifiers that match no
        content are ignored, as long as at least one matches. The tag is matched
        by name (case-insensitive)
      operationId: tagContent
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagContentsRequest'
        required: true
        description: Tag payload wrapped in a tag object
      responses:
        '200':
          description: The content was tagged
          content:
            application/json:
              schema:
                type: object
                properties:
                  tag:
                    $ref: '#/components/schemas/Tag'
                required:
                  - tag
        '400':
          description: The tag object is missing. The response has no body
        '401':
          description: >-
            The API key is missing or invalid. The response body is the text
            `HTTP Token: Access denied.`
        '404':
          description: No content matches the identifiers, or no tag has the name
          content:
            application/json:
              examples:
                error:
                  value:
                    errors:
                      content_urls:
                        - No matching items of content found
                      tag:
                        - 'No matching tag found for name: IBM'
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      content_urls:
                        type: array
                        items:
                          type: string
                        example:
                          - No matching items of content found
                      tag:
                        type: array
                        items:
                          type: string
                        example:
                          - 'No matching tag found for name: IBM'
                required:
                  - errors
        '422':
          description: The request failed validation
          content:
            application/json:
              examples:
                error:
                  value:
                    errors:
                      taggables:
                        - 'Content is already tagged: how-we-improved-onboarding'
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
                    example:
                      taggables:
                        - 'Content is already tagged: how-we-improved-onboarding'
                required:
                  - errors
      security:
        - tokenAuth: []
components:
  schemas:
    TagContentsRequest:
      type: object
      properties:
        tag:
          type: object
          properties:
            name:
              type: string
              example: IBM
              description: Name of an existing tag
            content_urls:
              type: array
              items:
                type: string
              example:
                - https://example.com/posts/how-we-improved-onboarding
              description: URLs of the content to tag
            content_slugs:
              type: array
              items:
                type: string
              example:
                - how-we-improved-onboarding
              description: Slugs of the content to tag
          required:
            - name
      required:
        - tag
    Tag:
      type: object
      properties:
        name:
          type: string
          example: IBM
        external_url:
          type: string
          nullable: true
          example: https://www.ibm.com
        external_id:
          type: string
          nullable: true
          example: '123'
        parent_name:
          type: string
          nullable: true
          example: Companies
          description: Name of the parent tag. Null for a top-level tag
        content_urls:
          type: array
          items:
            type: string
          example:
            - https://example.com/posts/how-we-improved-onboarding
      required:
        - name
        - content_urls
  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.