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

# Edit a default service

> Changes the fields you send on a default service and returns it. Fields
you leave out keep their value. `durations` and `location` are
replaced as a whole when sent.

A single-use service can't be edited: delete it and create a new one.

**Scope:** `services.write`




## OpenAPI

````yaml api-reference/openapi.yaml PATCH /services/{id}
openapi: 3.1.0
info:
  title: Tikk API
  version: 1.0.0
  summary: Your Tikk profile, services, free time slots and bookings.
  description: |
    A REST API over one Tikk account: its public profile, its services, the
    time slots it has free and the bookings people have made with it. Reading
    is the default; writing is limited to services.

    Every response is JSON, every timestamp is ISO 8601 in UTC, and every
    request needs a bearer token: an API key (`tikk_sk_...`) or an OAuth access
    token. Each endpoint requires one scope. Rate limit: 60 requests per minute
    per credential.
  contact:
    name: Tikk support
    url: https://tikk.chat
servers:
  - url: https://app.tikk.chat/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Profile
    description: Your public profile and plan.
  - name: Services
    description: Your default services and single-use links.
  - name: Availability
    description: The time slots you have free.
  - name: Bookings
    description: The bookings people have made with you.
paths:
  /services/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: >-
          The service `id`, as returned by `GET /services` or `POST /services`.
          Slugs aren't accepted.
        schema:
          type: integer
        example: 48213
    patch:
      tags:
        - Services
      summary: Edit a default service
      description: |
        Changes the fields you send on a default service and returns it. Fields
        you leave out keep their value. `durations` and `location` are
        replaced as a whole when sent.

        A single-use service can't be edited: delete it and create a new one.

        **Scope:** `services.write`
      operationId: updateService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DefaultServiceFields'
            example:
              title: Discovery call
              durations:
                - minutes: 45
                  price: 5000
      responses:
        '200':
          description: The updated service.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DefaultService'
                required:
                  - data
              examples:
                default:
                  $ref: '#/components/examples/DefaultService'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/MissingScope'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The service is single-use, and single-use services can't be edited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: >-
                  A single-use service cannot be edited. Delete it and create a
                  new one.
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - bearerAuth:
            - services.write
components:
  schemas:
    DefaultServiceFields:
      type: object
      description: The writable fields of a default service.
      properties:
        title:
          type: string
          maxLength: 50
          example: Intro call
        description:
          type:
            - string
            - 'null'
          maxLength: 500
          description: Shown on the booking page.
        slug:
          type: string
          maxLength: 100
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: |
            Lowercase letters, digits and single hyphens, unique among your
            services. Custom slugs need Pro: on Free the slug is generated from
            the title and a `slug` you send is ignored.
          example: intro-call
        durations:
          type: array
          minItems: 1
          description: Replaces all durations when sent.
          items:
            type: object
            properties:
              minutes:
                type: integer
                minimum: 5
                maximum: 480
                description: Length in minutes. No repeats.
                example: 30
              price:
                type:
                  - integer
                  - 'null'
                minimum: 0
                maximum: 999999
                description: Minor currency units, so `1500` is €15.00. `null` for free.
                example: 1500
            required:
              - minutes
        is_group:
          type: boolean
          description: >-
            Several people can book the same slot. Needs Pro; `true` on Free
            returns `422`.
        max_attendees:
          type:
            - integer
            - 'null'
          minimum: 2
          maximum: 50
          description: Seat cap. Required when `is_group` is `true`.
        requires_approval:
          type: boolean
          description: >-
            Accept each booking by hand. Needs Pro; on Free, bookings are always
            accepted automatically.
        location:
          type: object
          description: Replaces the location when sent.
          properties:
            type:
              type: string
              enum:
                - video
                - in_person
                - none
            address:
              type:
                - string
                - 'null'
              maxLength: 100
          required:
            - type
    DefaultService:
      title: Default service
      type: object
      description: A permanent booking page, such as "Intro call".
      properties:
        type:
          type: string
          const: default
        id:
          type: integer
          description: >-
            Pass it to `/services/{id}`, as `service` on `/availability`, and as
            `service` on `POST /services` to copy it into a single-use service.
          example: 48213
        slug:
          type: string
          description: The last segment of the service's booking URL.
          example: intro-call
        title:
          type: string
          example: Intro call
        description:
          type:
            - string
            - 'null'
          description: Shown on the booking page.
        is_default:
          type: boolean
          description: >-
            `true` for the one service your booking page highlights. Not the
            same as `type: default`.
        is_group:
          type: boolean
          description: '`true` if several people can book the same slot.'
        max_attendees:
          type:
            - integer
            - 'null'
          description: Seat cap for a group service. `null` otherwise.
        requires_approval:
          type: boolean
          description: '`true` if you accept each booking by hand.'
        durations:
          type: array
          description: The durations a booker can pick.
          items:
            $ref: '#/components/schemas/Duration'
        location:
          oneOf:
            - $ref: '#/components/schemas/ServiceLocation'
            - type: 'null'
          description: Where the meeting takes place.
        embed_url:
          type:
            - string
            - 'null'
          format: uri
          description: The service's booking URL. `null` until you pick a username.
          example: https://tikk.chat/jane/intro-call
      required:
        - type
        - id
        - slug
        - title
        - description
        - is_default
        - is_group
        - max_attendees
        - requires_approval
        - durations
        - location
        - embed_url
    Error:
      type: object
      properties:
        message:
          type: string
          description: What went wrong. Branch on the status code, not on this text.
      required:
        - message
    Duration:
      type: object
      properties:
        minutes:
          type: integer
          description: Length in minutes.
          example: 30
        price:
          type:
            - integer
            - 'null'
          description: >-
            Price in minor currency units, so `7500` is €75.00. `null` when
            free. Always `null` on single-use services, which are never paid.
          example: 7500
        currency:
          type: string
          description: ISO 4217 code. Always `EUR`.
          example: EUR
      required:
        - minutes
        - price
        - currency
    ServiceLocation:
      type: object
      properties:
        type:
          type: string
          enum:
            - video
            - in_person
            - none
          example: video
        label:
          type: string
          description: Human-readable name of the location type.
          example: Video Meeting
        address:
          type:
            - string
            - 'null'
          description: Only when you show the address publicly. `null` otherwise.
      required:
        - type
        - label
        - address
    MissingScopeError:
      type: object
      properties:
        message:
          type: string
          example: Missing required scope.
        scopes:
          type: array
          description: The scope or scopes the endpoint needs.
          items:
            type: string
      required:
        - message
        - scopes
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The to field must be a date after or equal to from.
        errors:
          type: object
          description: Failed rules, keyed by parameter name.
          additionalProperties:
            type: array
            items:
              type: string
          example:
            to:
              - The to field must be a date after or equal to from.
      required:
        - message
        - errors
  headers:
    X-RateLimit-Limit:
      description: Requests allowed per minute for this credential.
      schema:
        type: integer
        example: 60
    X-RateLimit-Remaining:
      description: Requests left in the current minute.
      schema:
        type: integer
        example: 59
  examples:
    DefaultService:
      summary: Default service
      value:
        data:
          type: default
          id: 48213
          slug: intro-call
          title: Intro call
          description: A first chat to see if we're a fit.
          is_default: true
          is_group: false
          max_attendees: null
          requires_approval: true
          durations:
            - minutes: 30
              price: null
              currency: EUR
            - minutes: 60
              price: 7500
              currency: EUR
          location:
            type: video
            label: Video Meeting
            address: null
          embed_url: https://tikk.chat/jane/intro-call
    MissingScope:
      summary: Missing scope
      value:
        message: Missing required scope.
        scopes:
          - services.write
  responses:
    Unauthorized:
      description: No credential was sent, or it's revoked, expired or unknown.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Unauthenticated.
    MissingScope:
      description: The credential doesn't carry the scope this endpoint needs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MissingScopeError'
          examples:
            missingScope:
              $ref: '#/components/examples/MissingScope'
    NotFound:
      description: |
        Nothing with this id on your account. Ids that belong to another
        account also return `404`: the API never confirms they exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Not found.
    ValidationFailed:
      description: One or more parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    TooManyRequests:
      description: More than 60 requests in a minute for this credential.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        An API key from **Settings → API Keys** (starts with `tikk_sk_`), or an
        OAuth access token for a partner app. Both carry scopes; each endpoint
        lists the one it needs.

````