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

# Update a badge

> Updates a badge identified by its id or third-party reference. Only the attributes sent are changed. Send a null group_uuid to remove the badge from its group



## OpenAPI

````yaml https://api.zapnito.com/api/docs/v1/swagger.json put /api/v1/badges/{id}
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/badges/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: The badge id, or its associated third-party reference
        schema:
          type: string
    put:
      tags:
        - Badges
      summary: Update a badge
      description: >-
        Updates a badge identified by its id or third-party reference. Only the
        attributes sent are changed. Send a null group_uuid to remove the badge
        from its group
      operationId: updateBadge
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BadgeUpdateRequest'
        required: true
        description: Badge payload wrapped in a badge object
      responses:
        '200':
          description: The badge was updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  badge:
                    $ref: '#/components/schemas/Badge'
                required:
                  - badge
        '400':
          description: The badge 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 badge has the id or third-party reference. The response has no
            body
        '422':
          description: The request failed validation
          content:
            application/json:
              examples:
                error:
                  value:
                    errors:
                      text:
                        - can't be blank
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      text:
                        type: array
                        items:
                          type: string
                        example:
                          - can't be blank
                required:
                  - errors
      security:
        - tokenAuth: []
components:
  schemas:
    BadgeUpdateRequest:
      type: object
      properties:
        badge:
          type: object
          properties:
            text:
              type: string
              example: Top Contributor
            color:
              type: string
              example: '#111111'
            text_color:
              type: string
              example: '#ffffff'
            position:
              type: integer
              example: 1
            available_to_anyone:
              type: boolean
              example: false
              description: >-
                Whether anyone can see the badge, rather than only members who
                are allowed to
            cta_label:
              type: string
              example: Learn more
            cta_url:
              type: string
              example: https://example.com
            cta_third_party_ref:
              type: string
              example: ABC123
            remote_brand_image_url:
              type: string
              example: https://example.com/image.png
              description: URL of an image to download and use as the badge brand image
            remote_brand_logo_url:
              type: string
              example: https://example.com/logo.png
              description: URL of an image to download and use as the badge brand logo
            group_uuid:
              type: string
              nullable: true
              example: abc-123
              description: >-
                UUID of the group whose members can see the badge. Send null to
                remove the badge from its group
      required:
        - badge
    Badge:
      type: object
      properties:
        id:
          type: integer
          example: 1
        text:
          type: string
          example: Top Contributor
        color:
          type: string
          example: '#111111'
        text_color:
          type: string
          example: '#ffffff'
        cta_label:
          type: string
          nullable: true
          example: Learn more
          description: Label of the badge call to action
        cta_url:
          type: string
          nullable: true
          example: https://example.com
          description: Where the badge call to action leads
        available_to_anyone:
          type: boolean
          example: false
          description: >-
            Whether anyone can see the badge, rather than only members who are
            allowed to
        position:
          type: integer
          example: 1
          description: Where the badge appears in the list. Lower numbers come first
        brand_image_url:
          type: string
          nullable: true
          example: https://example.com/image.png
          description: The brand image of the badge
        brand_logo_url:
          type: string
          nullable: true
          example: https://example.com/logo.png
          description: The brand logo of the badge
        cta_third_party_ref:
          type: string
          nullable: true
          example: ABC123
          description: >-
            Your own reference for the badge call to action. Can be used in
            place of the badge id
      required:
        - id
        - text
        - color
        - text_color
        - available_to_anyone
        - position
  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.