# Add a tag to an internal article

`POST /internal_articles/{internal_article_id}/tags`

> This is a subset of the full specification, limited to the `POST /internal_articles/{internal_article_id}/tags` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.18/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.18'
  description: This is a subset of the full specification, limited to the `POST /internal_articles/{internal_article_id}/tags` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Internal Articles
    description: Everything about your Internal Articles
  - name: Tags
    description: Everything about tags
paths:
  /internal_articles/{internal_article_id}/tags:
    post:
      summary: Add a tag to an internal article
      tags:
        - Internal Articles
        - Tags
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: internal_article_id
          in: path
          required: true
          description: The unique identifier for the internal article which is given by Intercom.
          example: 123
          schema:
            type: integer
      operationId: attachTagToInternalArticle
      description: |
        Apply an existing tag to an internal article. Returns the tag that was applied.

        The tag must already exist in the workspace (create tags with the Tags API),
        and the authenticating teammate must have the `manage_knowledge_base_content`
        permission.

        Requires the `read_write_articles_scope` OAuth scope.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - id
              properties:
                id:
                  type: string
                  description: The unique identifier of the tag to apply, as given by Intercom.
                  example: '7522907'
                admin_id:
                  type: string
                  nullable: true
                  description: Optional id of the teammate to attribute the tagging to. Defaults to the authenticating teammate. Does not affect authorization.
                  example: '1234'
            examples:
              successful:
                summary: Apply a tag
                value:
                  id: '7522907'
      responses:
        '200':
          description: Tag applied
          content:
            application/json:
              examples:
                Tag applied:
                  value:
                    type: tag
                    id: '7522907'
                    name: Independent
                    applied_at: 1663597223
                    applied_by:
                      type: admin
                      id: '1234'
              schema:
                $ref: '#/components/schemas/tag'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    type: error.list
                    request_id: 6f3c2b1a-2d4e-4f6a-9b8c-1a2b3c4d5e6f
                    errors:
                      - code: forbidden
                        message: Not authorized to manage knowledge base content
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Internal article, tag or teammate not found
          content:
            application/json:
              examples:
                Internal article not found:
                  value:
                    type: error.list
                    request_id: 302049fb-b8c1-4dc8-a327-a8f6e1923484
                    errors:
                      - code: internal_article_not_found
                        message: Internal article not found
                Tag not found:
                  value:
                    type: error.list
                    request_id: 8a3e4f88-ae65-433a-b4eb-46780ffc5402
                    errors:
                      - code: tag_not_found
                        message: Tag not found
                Teammate not found:
                  value:
                    type: error.list
                    request_id: 5d1f0c6e-7b7a-4c9d-8f3e-2a4b6c8d0e1f
                    errors:
                      - code: admin_not_found
                        message: Admin not found
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code.
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: '2.18'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
        - '2.16'
        - '2.17'
        - '2.18'
    reference:
      title: Reference
      type: object
      description: reference to another object
      properties:
        type:
          type: string
          description: ''
          example: contact
        id:
          type: string
          nullable: true
          description: ''
          example: 1a2b3c
    tag:
      title: Tag
      type: object
      x-tags:
        - Tags
      description: A tag allows you to label your contacts, companies, conversations, tickets, articles, internal articles, content snippets and external pages, and list them using that tag.
      properties:
        type:
          type: string
          description: value is "tag"
          example: tag
        id:
          type: string
          description: The id of the tag
          example: '123456'
        name:
          type: string
          description: The name of the tag
          example: Test tag
        applied_at:
          type: integer
          format: timestamp
          nullable: true
          description: The time when the tag was applied to the object. Only present when the tag is returned as part of a tagging operation on a contact, conversation, ticket, article, internal article, content snippet, or external page, when listing the tags on a contact, or when it is returned as part of an external page. `null` when the tag has just been removed from an article, internal article, content snippet or external page. Removing a tag from a contact, conversation or ticket returns the original value.
          example: 1663597223
        applied_by:
          type: object
          nullable: true
          description: The admin who applied the tag. Only present when the tag is returned as part of a tagging operation on a contact, conversation, ticket, article, internal article, content snippet, or external page, when listing the tags on a contact, or when it is returned as part of an external page. `null` when the tag has just been removed from an article, internal article, content snippet or external page. Removing a tag from a contact, conversation or ticket returns the original value. When no admin is recorded, `type` is `nobody_admin` and `id` is `null`.
          allOf:
            - $ref: '#/components/schemas/reference'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          examples:
            Unauthorized:
              value:
                type: error.list
                request_id: 12a938a3-314e-4939-b773-5cd45738bd21
                errors:
                  - code: unauthorized
                    message: Access Token Invalid
          schema:
            $ref: '#/components/schemas/error'
```
