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

# Create a benefit

> Create a benefit. <h3>OAuth</h3>Required scopes: <code>benefits</code>



## OpenAPI

````yaml /assets/openapi.json post /benefits/v1
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /benefits/v1:
    post:
      tags:
        - Benefits
      summary: Create a benefit
      description: 'Create a benefit. <h3>OAuth</h3>Required scopes: <code>benefits</code>'
      operationId: createBenefit
      parameters:
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      requestBody:
        $ref: '#/components/requestBodies/createBenefit'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/benefit'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - benefits.create
components:
  requestBodies:
    createBenefit:
      content:
        application/json:
          schema:
            type: object
            properties:
              benefit:
                description: Benefit to create.
                type: object
                properties:
                  application:
                    default:
                      allowance: unlimited
                      buttonLabel: apply
                      confirmationEmail:
                        enabled: false
                        template: ''
                      enabled: true
                    type: object
                    properties:
                      allowance:
                        description: >-
                          How often a user can apply: 'once' limits to a single
                          use, 'unlimited' allows repeated use.
                        default: unlimited
                        type: string
                        enum:
                          - once
                          - unlimited
                      buttonLabel:
                        description: Label on the call-to-action button.
                        default: apply
                        type: string
                        enum:
                          - apply
                          - buy
                          - contact
                          - get
                          - learnMore
                      confirmationEmail:
                        description: Confirmation email settings for applications.
                        type: object
                        properties:
                          enabled:
                            description: >-
                              Whether a confirmation email is sent after
                              applying.
                            default: false
                            type: boolean
                          template:
                            description: HTML template for the confirmation email.
                            default: ''
                            type: string
                      enabled:
                        description: >-
                          Whether the application flow is enabled for this
                          benefit.
                        default: true
                        type: boolean
                    required:
                      - confirmationEmail
                  categoryRef:
                    description: ID of the benefit category this benefit belongs to.
                    type: string
                    format: uuid
                  description:
                    description: Full description of the benefit.
                    default: ''
                    type: string
                  featured:
                    description: Whether the benefit is highlighted in listings.
                    default: false
                    type: boolean
                  locationRef:
                    description: ID of the location this benefit is associated with.
                    type: string
                    format: uuid
                  media:
                    description: Media files to attach. The url is generated server-side.
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          description: Storage key of the media file.
                          type: string
                      required:
                        - key
                  subtitle:
                    description: Short tagline displayed below the title.
                    default: ''
                    type: string
                  title:
                    description: Display name of the benefit.
                    type: string
                    minLength: 1
                  visibility:
                    description: >-
                      Who can see this benefit: 'public' (everyone), 'admins',
                      'members', or 'networkMembers'.
                    default: public
                    type: string
                    enum:
                      - public
                      - admins
                      - members
                      - networkMembers
                required:
                  - categoryRef
                  - locationRef
                  - title
            required:
              - benefit
      required: true
  schemas:
    benefit:
      type: object
      properties:
        application:
          description: Settings controlling how users apply for this benefit.
          type: object
          properties:
            allowance:
              description: >-
                How often a user can apply: 'once' limits to a single use,
                'unlimited' allows repeated use.
              type: string
              enum:
                - once
                - unlimited
            buttonLabel:
              description: Label on the call-to-action button.
              type: string
              enum:
                - apply
                - buy
                - contact
                - get
                - learnMore
            confirmationEmail:
              type: object
              properties:
                enabled:
                  description: Whether a confirmation email is sent after applying.
                  type: boolean
                template:
                  description: HTML template for the confirmation email.
                  type: string
              required:
                - enabled
                - template
              additionalProperties: false
            enabled:
              description: Whether the application flow is enabled for this benefit.
              type: boolean
          required:
            - allowance
            - buttonLabel
            - confirmationEmail
            - enabled
          additionalProperties: false
        categoryRef:
          description: ID of the benefit category this benefit belongs to.
          type: string
          format: uuid
        createDate:
          description: ISO timestamp of when the benefit was created.
          type: string
          format: date-time
        description:
          description: Full description of the benefit.
          type: string
        featured:
          description: Whether the benefit is highlighted in listings.
          type: boolean
        id:
          description: Unique identifier of the benefit.
          type: string
          format: uuid
        locale:
          description: Auto-detected language of the description.
          type: string
        locationRef:
          description: ID of the location this benefit is associated with.
          type: string
          format: uuid
        media:
          description: Media files attached to this benefit.
          type: array
          items:
            type: object
            properties:
              key:
                description: Storage key of the media file.
                type: string
              url:
                description: Public URL of the media file.
                type: string
            required:
              - key
              - url
            additionalProperties: false
        networkRef:
          description: ID of the network this benefit belongs to.
          type: string
          format: uuid
        subtitle:
          description: Short tagline displayed below the title.
          type: string
        title:
          description: Display name of the benefit.
          type: string
        updateDate:
          description: ISO timestamp of the last update.
          type: string
          format: date-time
        visibility:
          description: >-
            Who can see this benefit: 'public' (everyone), 'admins', 'members',
            or 'networkMembers'.
          type: string
          enum:
            - public
            - admins
            - members
            - networkMembers
      required:
        - application
        - categoryRef
        - createDate
        - description
        - featured
        - id
        - locale
        - locationRef
        - media
        - networkRef
        - subtitle
        - title
        - visibility
      additionalProperties: false
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read invoices
            invoices: Read and write invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````