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

# Change service status

> The publish switch: only LIVE services are bookable. Allowed transitions are DRAFT to LIVE, DRAFT to INACTIVE, LIVE to INACTIVE and INACTIVE to LIVE; anything else is a 400. Note there is no route back to DRAFT once published, so a service you want to keep working on privately should go to INACTIVE, not be published early. INACTIVE stops new bookings and leaves existing ones intact.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/projects/{projectId}/services/{serviceId}/status
openapi: 3.0.0
info:
  title: MarketBox 2.0 Open API
  version: 1.0.0
  description: >-
    The MarketBox public API for building booking experiences. Core model:
    create an order, then draw its order items down into bookings. Single
    bookings reference an order item per service line; package bookings draw one
    PACKAGE item down across N sessions. To schedule a package, build a slate
    (POST /availability/package-slate) and book it by slateId (POST
    /orders/{orderId}/package-bookings). See the guides for end-to-end
    walkthroughs.
  contact:
    name: MarketBox support
servers:
  - url: https://apiv2.gomarketbox.com
    description: MarketBox Open API
security:
  - ApiKeyAuth: []
paths:
  /v1/projects/{projectId}/services/{serviceId}/status:
    post:
      tags:
        - Services
      summary: Change service status
      description: >-
        The publish switch: only LIVE services are bookable. Allowed transitions
        are DRAFT to LIVE, DRAFT to INACTIVE, LIVE to INACTIVE and INACTIVE to
        LIVE; anything else is a 400. Note there is no route back to DRAFT once
        published, so a service you want to keep working on privately should go
        to INACTIVE, not be published early. INACTIVE stops new bookings and
        leaves existing ones intact.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              The project (tenant) that owns the resource. Every resource in
              this API is scoped to a project, and your API key is restricted to
              the projects it was issued for — a project outside that scope
              returns 403.
            example: prj_01kv60qgnef2kt3pvqgwmkbzfr
          required: true
          description: >-
            The project (tenant) that owns the resource. Every resource in this
            API is scoped to a project, and your API key is restricted to the
            projects it was issued for — a project outside that scope returns
            403.
          name: projectId
          in: path
        - schema:
            type: string
            minLength: 1
            description: >-
              The service — the sellable thing (a lesson, a treatment).
              Offerings hang off a service and carry the duration and price.
            example: srv_01kv60qg12e82acr78edfnjhvv
          required: true
          description: >-
            The service — the sellable thing (a lesson, a treatment). Offerings
            hang off a service and carry the duration and price.
          name: serviceId
          in: path
      requestBody:
        description: New status
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - DRAFT
                    - LIVE
                    - INACTIVE
                  description: >-
                    Lifecycle of the service. Only LIVE services are bookable;
                    DRAFT is unpublished and INACTIVE is retired.
              required:
                - status
      responses:
        '200':
          description: Updated service
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - SERVICE
                      projectId:
                        type: string
                      serviceId:
                        type: string
                      categoryId:
                        type: string
                      categorySnapshot:
                        type: object
                        properties:
                          categoryId:
                            type: string
                          primaryName:
                            type: string
                          primaryNameNormalized:
                            type: string
                        required:
                          - categoryId
                          - primaryName
                          - primaryNameNormalized
                      name:
                        type: object
                        additionalProperties:
                          type: string
                      description:
                        type: object
                        additionalProperties:
                          type: string
                      primaryLanguage:
                        type: string
                      primaryName:
                        type: string
                      primaryNameNormalized:
                        type: string
                      status:
                        type: string
                        enum:
                          - DRAFT
                          - LIVE
                          - INACTIVE
                        description: >-
                          Lifecycle of the service. Only LIVE services are
                          bookable; DRAFT is unpublished and INACTIVE is
                          retired.
                      taxSettings:
                        type: object
                        properties:
                          taxable:
                            type: boolean
                          taxPercentage:
                            type: number
                            minimum: 0
                        required:
                          - taxable
                      participantSettings:
                        $ref: '#/components/schemas/ParticipantSettings'
                      bufferBeforeStartMinutes:
                        type: integer
                        minimum: 0
                        maximum: 120
                      counts:
                        type: object
                        properties:
                          offerings:
                            type: integer
                            minimum: 0
                        required:
                          - offerings
                      deleted:
                        type: boolean
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      createdBy:
                        type: string
                      updatedBy:
                        type: string
                    required:
                      - entityType
                      - projectId
                      - serviceId
                      - categoryId
                      - categorySnapshot
                      - name
                      - description
                      - primaryLanguage
                      - primaryName
                      - primaryNameNormalized
                      - status
                      - taxSettings
                      - counts
                      - deleted
                      - createdAt
                      - updatedAt
                      - createdBy
                      - updatedBy
                required:
                  - data
        '400':
          description: Invalid transition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: API key cannot access this project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    ParticipantSettings:
      type: object
      properties:
        supplier:
          type: object
          properties:
            canCancelBookings:
              type: boolean
              description: Suppliers can cancel upcoming sessions they are assigned to.
              example: false
            cancelNoticeHours:
              type: integer
              minimum: 0
              maximum: 8760
              description: >-
                Minimum hours before the session starts that this action is
                still allowed. 0 = allowed any time before the start.
              example: 24
            canRescheduleBookings:
              type: boolean
              description: >-
                Suppliers can move an upcoming session to another time (same
                supplier).
              example: true
            rescheduleNoticeHours:
              type: integer
              minimum: 0
              maximum: 8760
              description: >-
                Minimum hours before the session starts that this action is
                still allowed. 0 = allowed any time before the start.
              example: 24
            canSeeClientLastName:
              type: boolean
              description: >-
                When false, suppliers see the client first name and last initial
                only.
              example: true
            canSeeClientEmail:
              type: boolean
              description: Suppliers can see the client email address.
              example: false
            canSeeClientPhone:
              type: boolean
              description: Suppliers can see the client phone number.
              example: false
          required:
            - canCancelBookings
            - cancelNoticeHours
            - canRescheduleBookings
            - rescheduleNoticeHours
            - canSeeClientLastName
            - canSeeClientEmail
            - canSeeClientPhone
          description: What suppliers may do with, and see on, bookings of this service.
          example:
            canCancelBookings: false
            cancelNoticeHours: 24
            canRescheduleBookings: true
            rescheduleNoticeHours: 24
            canSeeClientLastName: true
            canSeeClientEmail: false
            canSeeClientPhone: false
        client:
          type: object
          properties:
            canRescheduleBookings:
              type: boolean
              description: >-
                Clients can move their own upcoming sessions to another
                available time.
              example: true
            rescheduleNoticeHours:
              type: integer
              minimum: 0
              maximum: 8760
              description: >-
                Minimum hours before the session starts that this action is
                still allowed. 0 = allowed any time before the start.
              example: 24
            participantDisplay:
              type: string
              enum:
                - HIDDEN
                - FIRST_NAME
                - FULL
              description: >-
                How participants are named to clients on their own bookings:
                FULL (full names), FIRST_NAME (first names only) or HIDDEN (no
                names; a count such as "2 participants").
              example: FULL
          required:
            - canRescheduleBookings
            - rescheduleNoticeHours
          description: >-
            What clients may do with, and see on, their own bookings of this
            service. Clients cannot cancel.
          example:
            canRescheduleBookings: true
            rescheduleNoticeHours: 24
            participantDisplay: FULL
      required:
        - supplier
        - client
      description: >-
        Participant interaction settings: what suppliers and clients may do
        with, and see on, bookings of this service. Replaced whole on update —
        send every field, except `client.participantDisplay`: omitted, it keeps
        its stored value. Enforced for supplier- and client-role callers;
        API-key (integrator) calls act for the business and are not restricted
        by it.
      example:
        supplier:
          canCancelBookings: false
          cancelNoticeHours: 24
          canRescheduleBookings: true
          rescheduleNoticeHours: 24
          canSeeClientLastName: true
          canSeeClientEmail: false
          canSeeClientPhone: false
        client:
          canRescheduleBookings: true
          rescheduleNoticeHours: 24
          participantDisplay: FULL
    ErrorMessage:
      type: object
      properties:
        code:
          type: string
          description: Stable machine-readable error code, e.g. NOT_FOUND.
        message:
          type: string
          description: Human-readable description of what went wrong.
        statusCode:
          type: integer
          description: The HTTP status code of this response.
        requestId:
          type: string
          description: >-
            The id of this request, also returned as the X-Request-Id header.
            Quote it in a support ticket.
      required:
        - code
        - message
        - statusCode
        - requestId
      example:
        code: NOT_FOUND
        message: Booking not found
        statusCode: 404
        requestId: a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key minted in the MarketBox dashboard. Scope is restricted to the
        projects you select at creation time. Every route needs the key's
        standard API access (`*`) except `POST /v1/projects/{projectId}/events`,
        which needs `events:write`; a key without `*` is refused with 403
        `CAPABILITY_NOT_GRANTED`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.