---
title: "Add a companion"
method: POST
path: "/api/persons/{personId}/companions"
tags: ["person-controller"]
---

# Add a companion

`POST /api/persons/{personId}/companions`

Add a companion to the repository.

## Path parameters

- `personId` string, required

## Request body

- CompanionRequest
  - `expiringDtm` TimestampReq
    - `date` integer
    - `hours` integer
    - `minutes` integer
    - `month` integer
    - `nanos` integer
    - `seconds` integer
    - `time` integer
    - `year` integer
  - `firstName` string — First name
  - `lastName` string — Last name
  - `privateInfo` PrivateInfo
    - `attributes` Attribute[]
      - `credentialAttributeName` string
      - `credentialAttributeValue` string
      - `credentialType` string

## Response `200`

OK

- CompanionResponse
  - `createdDtm` TimestampRes
    - `date` integer
    - `day` integer
    - `hours` integer
    - `minutes` integer
    - `month` integer
    - `nanos` integer
    - `seconds` integer
    - `time` integer
    - `timezoneOffset` integer
    - `year` integer
  - `expiringDtm` TimestampRes
    - `date` integer
    - `day` integer
    - `hours` integer
    - `minutes` integer
    - `month` integer
    - `nanos` integer
    - `seconds` integer
    - `time` integer
    - `timezoneOffset` integer
    - `year` integer
  - `firstName` string — First name
  - `href` string — href
  - `id` string — ID
  - `lastName` string — lastName
  - `lastUpdatedDtm` TimestampRes
    - `date` integer
    - `day` integer
    - `hours` integer
    - `minutes` integer
    - `month` integer
    - `nanos` integer
    - `seconds` integer
    - `time` integer
    - `timezoneOffset` integer
    - `year` integer
  - `personId` string — personId
  - `privateInfo` PrivateInfo
    - `attributes` Attribute[]
      - `credentialAttributeName` string
      - `credentialAttributeValue` string
      - `credentialType` string

## Other responses

- `201` — Created
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Unexpected error in processing the request.

---

[API](https://skmtc.dev/myverifly/apis/api-documentation.md) · [All operations](https://skmtc.dev/myverifly/apis/api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/myverifly/api-documentation/revisions/03f300608c33/schema)
