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

# Add user on customer

> Add a new user (party) to a customer. Use this to add for example a driver, a representative or another party that should be able to receive communication on the customer's cases.



## OpenAPI

````yaml POST /v1/{tenantId}/customers/{customerId}/users
openapi: 3.1.0
info:
  title: Debbie API Docs
  description: >
    The Debbie API is a RESTful interface, allowing you to programmatically

    update, add and access your data in the platform. It provides predictable
    URLs

    for accessing resources, and uses built-in HTTP features to receive commands
    and

    return responses. This makes it easy to communicate with third party
    systems.


    ## Idempotency


    The Debbie API supports idempotency for non-idempotent requests through the
    optional `Idempotency-Key` header. 

    This ensures that retrying the same request multiple times will produce the
    same result, preventing duplicate operations.


    ### Using Idempotency Keys


    - Include an `Idempotency-Key` header with a unique string (we recommend
    UUIDs)  

    - Maximum key length is 64 characters

    - Keys are valid for 48 hours

    - Responses served from the idempotency cache include an
    `Idempotency-Cached` header


    ### Example

    ```http

    Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000

    ```


    ### Error Cases

    - Invalid key format: 400 Bad Request

    - Reusing a key for a different request: 400 Bad Request


    ### Best Practices

    - Use a new key for each unique business transaction

    - Use the same key when retrying a failed request 

    - Store keys with request details for debugging
  contact:
    email: api-support@debbie.dk
  version: v0.1.0
servers:
  - url: https://api.debbiecollect.com
security:
  - bearerAuth: []
tags:
  - name: Authorization
    description: Endpoints for interacting with authorization
  - name: Cases
    description: Endpoints for interacting with cases
  - name: Customers
    description: Endpoints for interacting with customers
  - name: Creditors
    description: Endpoints for interacting with creditors
  - name: Ultimate creditors
    description: >-
      Endpoints for interacting with ultimate creditors. An ultimate creditor is
      the original creditor behind the creditor on a case — for example when a
      debt collection agency forwards cases on behalf of its own client. On
      cases with an ultimate creditor, the creditor template mentions (name,
      address and company identifier) use the details of the ultimate creditor.
  - name: Updates
    description: Endpoints for interacting with updates
  - name: Users
    description: Endpoints for interacting with updates
  - name: Files
    description: Endpoints for interacting with files
  - name: Case vouchers
    description: Endpoints for interacting with case vouchers
  - name: Voucher types
    description: The voucher types of the tenant, used to categorize case vouchers
  - name: Interactions
    description: >-
      Interactions are messages and notes on a case, for example an incoming
      message from a debtor.
  - name: Billing
    description: Endpoints for interacting with billing
  - name: Links
    description: Endpoints for generating links
  - name: Webhooks
    description: >-
      Debbie provides a range of webhooks. To try them out please visit Debbie
      Caseworker and navigate to Settings --> Developers --> Webhooks.
externalDocs:
  description: Find out more about Debbie here
  url: https://debbiecollect.com
paths:
  /v1/{tenantId}/customers/{customerId}/users:
    post:
      tags:
        - Customers
      summary: Add user on customer
      description: >-
        Add a new user (party) to a customer. Use this to add for example a
        driver, a representative or another party that should be able to receive
        communication on the customer's cases.
      operationId: add-user-on-customer
      parameters:
        - in: path
          name: tenantId
          schema:
            type: string
            format: uuid
          required: true
          description: Id of the tenant the customer belongs to
        - in: path
          name: customerId
          schema:
            type: string
            format: uuid
          required: true
          description: Id of the customer
      requestBody:
        description: New user on customer body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewUserOnCustomer'
            example:
              lang: da
              contact: true
              relation: alternative-contact
              details:
                name: Hans Hansen
                email: example@debbie.dk
                description: Driver of the vehicle
                phone:
                  locale: '45'
                  number: '12345678'
                address:
                  address: Applebys Plads 7, 1.
                  city: København K
                  zipcode: '1411'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserOnCustomer'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    NewUserOnCustomer:
      type: object
      required:
        - lang
        - contact
        - relation
      properties:
        lang:
          $ref: '#/components/schemas/Language'
          description: The language of the user
        contact:
          type: boolean
          description: Whether the user should be the contact person of the customer
        relation:
          type: string
          enum:
            - debtor
            - alternative-contact
          description: >-
            The relation of the user to the customer. Use alternative-contact
            for a party that is not the debtor itself, for example a driver or a
            representative.
        details:
          type: object
          properties:
            name:
              type: string
              description: Name of the user
            email:
              type: string
              description: The email of the user
            description:
              type: string
              description: A description of the user. For example the role of the party.
            phone:
              type: object
              description: The users' phone number with locale
              properties:
                number:
                  type: string
                  description: The users' phone number. For example 12345678.
                locale:
                  type: string
                  description: The users' phone locale. For example 45.
            address:
              $ref: '#/components/schemas/Address'
              description: The users' address
    UserOnCustomer:
      type: object
      properties:
        userId:
          type: string
          format: uuid
          description: Id of the user
        id:
          type: number
          description: Sequential id of the user
        relation:
          type: string
          enum:
            - debtor
            - alternative-contact
          description: Type of relation to the customer
        contact:
          type: boolean
          description: Whether the user is the contact person
        customerId:
          type: string
          format: uuid
          description: Id of the customer
        lang:
          $ref: '#/components/schemas/Language'
          description: The language of the user
        details:
          type: object
          properties:
            name:
              type: string
              description: Name of the user
            cpr:
              type: string
              description: The cpr number of a user, only used when user is a person.
            cvr:
              type: string
              description: The cvr number of a user, only used when user is a company.
            email:
              type: string
              description: The email of the user
            phone:
              type: object
              description: The users' phone number with locale
              properties:
                number:
                  type: string
                  description: The users' phone number. For example 12345678.
                locale:
                  type: string
                  description: The users' phone locale. For example 45.
            address:
              $ref: '#/components/schemas/Address'
              description: The debtors address
            geocode:
              type: object
              properties:
                latitude:
                  type: number
                longitude:
                  type: number
    Language:
      type: string
      enum:
        - bm
        - ba
        - eu
        - be
        - bn
        - bh
        - bi
        - bs
        - br
        - bg
        - my
        - ca
        - ch
        - ce
        - ny
        - zh
        - cv
        - kw
        - co
        - cr
        - hr
        - cs
        - da
        - dv
        - nl
        - dz
        - en
        - eo
        - et
        - ee
        - fo
        - fj
        - fi
        - fr
        - ff
        - gl
        - ka
        - de
        - el
        - gn
        - gu
        - ht
        - ha
        - he
        - hz
        - hi
        - ho
        - hu
        - ia
        - id
        - ie
        - ga
        - ig
        - ik
        - io
        - is
        - it
        - iu
        - ja
        - jv
        - kl
        - kn
        - kr
        - ks
        - kk
        - km
        - ki
        - rw
        - ky
        - kv
        - kg
        - ko
        - ku
        - kj
        - la
        - lb
        - lg
        - li
        - ln
        - lo
        - lt
        - lu
        - lv
        - gv
        - mk
        - mg
        - ms
        - ml
        - mt
        - mi
        - mr
        - mh
        - mn
        - na
        - nv
        - nd
        - ne
        - ng
        - nb
        - nn
        - 'no'
        - ii
        - nr
        - oc
        - oj
        - cu
        - om
        - or
        - os
        - pa
        - pi
        - fa
        - pl
        - ps
        - pt
        - qu
        - rm
        - rn
        - ro
        - ru
        - sa
        - sc
        - sd
        - se
        - sm
        - sg
        - sr
        - gd
        - sn
        - si
        - sk
        - sl
        - so
        - st
        - es
        - su
        - sw
        - ss
        - sv
        - ta
        - te
        - tg
        - th
        - ti
        - bo
        - tk
        - tl
        - tn
        - to
        - tr
        - ts
        - tt
        - tw
        - ty
        - ug
        - uk
        - ur
        - uz
        - ve
        - vi
        - vo
        - wa
        - cy
        - wo
        - fy
        - xh
        - yi
        - yo
        - za
        - zu
      description: Language.
    Address:
      type: object
      properties:
        address:
          type: string
          description: The street name and number of the address
        coAddress:
          type: string
        zipcode:
          type: string
        city:
          type: string
        country:
          type: string
      required:
        - address
        - zipcode
        - city
  responses:
    UnauthorizedError:
      description: Access token missing or invalid
    UnprocessableContent:
      description: Unable to process the contained instructions.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication can be done by using a bearer token in the Authorization
        header. This is done using the following format `Authorization: Bearer
        {token}`.

````