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

# Create Badge

> Create a badge for a community. Badges are used to enable on-chain attestations of achievements, events, and more.

<Info>
  When creating badges you can make use of [Community Files](/api-reference/community-files/create-a-file-upload) to upload images and and use the OpenPage image cdn as the source URL.
  For IPFS images an easy and cost effective solution is to use a service like [Pinata](https://www.pinata.cloud/) to upload and pin the IPFS image.
</Info>

<Info>
  New Badges created via the API are marked as `approved` by default. To begin creating badge attributions you will need to update the status to `live` using the [Update Badge](/api-reference/community-badges/update-badge) endpoint. Once Badges are set to `live` they will be visible publicly on OpenPage and across the OpenPage ecosystem.
</Info>

<Info>
  Approved badges can be previewed at: `https://openpage.fun/badges/{badgeId}`
</Info>


## OpenAPI

````yaml POST /community/{id}/badge
openapi: 3.0.0
info:
  title: OpenPage API Reference
  description: ''
  version: '1.0'
  contact: {}
servers:
  - url: https://api.openpage.fun/v1
security: []
tags:
  - name: Launcher
    description: >-
      Launcher endpoints are used to interact with your embedded or external
      experiences.


      **Launcher endpoints require setting up a Community Experience.**


      See: [Community
      Experiences](/api-reference/community-experiences/create-experience)
  - name: Communities
    description: >-
      Community endpoints are used to retrieve information about your
      Communities and associated members.


      **Community API endpoints require an API key obtained from the Community
      dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
  - name: Community Badges
    description: >-
      Community Badge endpoints are used to create and manage badges, their
      associated rewards, and member attributions.


      **Community Badge endpoints require an API key obtained from the Community
      dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
  - name: Community Files
    description: >-
      Community File endpoints are used to create and manage files used for
      Badges and Collections.


      **Community File endpoints require an API key obtained from the Community
      dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
  - name: Community Experiences
    description: >-
      Community Experience endpoints are used to create and manage experiences.


      **Community Experience endpoints require an API key obtained from the
      Community dashboard.**


      [Community Dashboard](https://portal.openpage.fun)
paths:
  /community/{id}/badge:
    post:
      tags:
        - Community Badges
      summary: Create badge
      operationId: CommunityBadgeController_createCommunityBadge
      parameters:
        - name: id
          required: true
          in: path
          description: Community ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBadgeDto'
      responses:
        '201':
          description: ''
      security:
        - apiKey: []
components:
  schemas:
    CreateBadgeDto:
      type: object
      properties:
        status:
          type: string
          example: live
          enum:
            - draft
            - under_review
            - approved
            - rejected
            - live
        title:
          type: string
        image:
          type: string
          description: The image URL of the badge. Can be an IPFS url or OpenPage File.
        type:
          type: string
          enum:
            - achievement
            - attendance
        description:
          type: string
        chainId:
          type: string
          description: The chain ID of the badge.
          example: '11155111'
        contract:
          type: string
        claimEndDate:
          format: date-time
          type: string
        maxClaims:
          type: number
        tags:
          description: >-
            Array of tags. Members with matching tags are eligible to claim the
            badge.
          type: array
          items:
            $ref: '#/components/schemas/BadgeTagDto'
        author:
          $ref: '#/components/schemas/BadgeAuthorDto'
      required:
        - title
        - image
        - type
        - description
        - claimEndDate
        - maxClaims
        - tags
        - author
    BadgeTagDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
    BadgeAuthorDto:
      type: object
      properties:
        name:
          type: string
        uri:
          type: string
      required:
        - name
        - uri
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-Api-Key
      in: header

````