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

# Create an activity code

> Creates an activity code.



## OpenAPI

````yaml /openapi.json post /activitycodes
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /activitycodes:
    post:
      tags:
        - Activity Codes
      summary: Create an activity code
      description: Creates an activity code.
      operationId: CreateActivityCode
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ActivityDto'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ActivityDto'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ActivityDto'
      responses:
        '202':
          description: >-
            When request is accepted. Returns a hypermedia 'Link' object of the
            activity code to be created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          description: When an unsupported request is made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    ActivityDto:
      type: object
      properties:
        updatedByUserId:
          type: string
          description: "Unique identifier of the user updating the activity.\r\n\r\nThis field is reserved for server-to-server operations."
          nullable: true
          example: 750eb5c5-ac0b-7d11-4997-e0ce9d8896c8
        type:
          allOf:
            - $ref: '#/components/schemas/EntryType'
          description: "Type of the activity.\r\n\r\nPossible values: Fixed = '0', Time = '1', Expense = '2'"
          example: 0
        description:
          type: string
          description: Description of the activity.
          nullable: true
          example: Review contract
        code:
          type: string
          description: Code of the activity. Cannot be longer than 20 characters.
          nullable: true
          example: RC
        isBillable:
          type: boolean
          description: True if the activity is billable.
          example: false
        rateType:
          allOf:
            - $ref: '#/components/schemas/ActivityRateType'
          description: "The activity rate type.\r\n            \r\nPossible values: UseDefaultStaffRate = '0', OverrideRateForAllStaff = '1', OverrideRatePerStaff = '2'"
          example: 0
        rate:
          type: number
          description: "Rate of the activity in dollars.\r\n\r\nIf set, rateType must be OverrideRateForAllStaff"
          format: double
          nullable: true
          example: 23.21
        quantity:
          type: number
          description: "Quantity of the activity. This is the default value used when creating an expense or time-based fee.\r\n\r\nFor type 'Expense', this field represents the quantity of the expense in units.\r\nFor type 'Time', this field represents the duration of in minutes, divided by 100,\r\ne.g. for 1 hour duration, quantity is 0.6, which is 60 minutes divided by 100.\r\n\r\nApplies only for 'Time' and 'Expense' types. Not applicable for activity type 'Fixed'."
          format: double
          nullable: true
          example: 0.6
        taxInclusive:
          type: boolean
          description: "If true, the amount is tax inclusive, otherwise tax exclusive. Only applicable in AU and UK regions.\r\n\r\nTax inclusive means: Amount exc. tax = Amount - Tax, Amount inc. tax = Amount.\r\n\r\nTax exclusive means: Amount exc. tax = Amount, Amount inc. tax = Amount + Tax."
          example: false
        taxExempt:
          type: boolean
          description: "True if the activity is exempt from tax.\r\n\r\nThis field is mutually exclusive with TaxZeroRated and TaxOutOfScope."
          example: false
        taxZeroRated:
          type: boolean
          description: "True if the activity is zero-rated for tax purposes. Only supported in UK regions.\r\n\r\nThis field is mutually exclusive with TaxOutOfScope and TaxExempt."
          example: false
        taxOutOfScope:
          type: boolean
          description: "True if the activity is out of scope for tax purposes. Only supported in UK regions.\r\n\r\nThis field is mutually exclusive with TaxZeroRated and TaxExempt."
          example: false
        inputTaxRate:
          type: number
          description: "Input tax rate of the activity in a percentage accurate to two decimal places.\r\ne.g: 45.63"
          format: double
          nullable: true
        outputTaxRate:
          type: number
          description: "Output tax rate of the activity percentage accurate to two decimal places.\r\ne.g: 45.63"
          format: double
          nullable: true
      additionalProperties: false
    Link:
      type: object
      properties:
        id:
          type: string
          nullable: true
        href:
          type: string
          nullable: true
        relation:
          type: string
          nullable: true
        method:
          type: string
          default: GET
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    EntryType:
      enum:
        - 0
        - 1
        - 2
      type: integer
      description: "Type of the activity.\r\n\r\nPossible values: Fixed = '0', Time = '1', Expense = '2'"
      format: int32
    ActivityRateType:
      enum:
        - 0
        - 1
        - 2
      type: integer
      description: "The activity rate type.\r\n\r\nPossible values: UseDefaultStaffRate = '0', OverrideRateForAllStaff = '1', OverrideRatePerStaff = '2'"
      format: int32
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````