---
title: "Match a consumer to an identity source user"
method: POST
path: "/apiops/projects/{projectName}/consumers/{consumerKey}/actions/sync-match"
tags: ["Consumer"]
---

# Match a consumer to an identity source user

`POST /apiops/projects/{projectName}/consumers/{consumerKey}/actions/sync-match`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/consumers/{consumerKey}/actions/sync-match`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/consumers/:consumerKey/actions/sync-match/post.ts> (a function with typed inputs; its response is checked against the schema)

Binds the consumer to a user of an identity source of the project, by the source's name (sourceType ldap, database or api, any other is 400; sourceName; username = the key the next sync reconciles on; optional email, fullName, ldapDn). The consumer becomes sync-managed: the source owns its identity fields from then on. An unknown source is 404; a source whose synchronization is disabled is 400 (reason syncProviderDisabled); a username another consumer holds is 400 (reason credentialUsernameTaken). The same step the Consumer screen's match flow runs; runtimeDeployment reports the gateway push.

## Path parameters

- `projectName` string, required
- `consumerKey` string, required

## Request body

- ApiOpsConsumerSyncMatchDTO
  - `sourceType` string
  - `sourceName` string
  - `username` string
  - `email` string
  - `fullName` string
  - `ldapDn` string

## Response `200`

OK

- ApiOpsMutationResponseApiOpsResponseConsumer
  - `status` 'SUCCESS' | 'FAILURE'
  - `resourceVersion` integer
  - `runtimeDeployment` ApiOpsRuntimeDeploymentDTO
    - `state` 'IN_SYNC' | 'DEGRADED'
    - `environments` Environment[]
      - `name` string
      - `acknowledged` boolean
      - `detail` string
  - `result` ApiOpsResponseConsumer
    - `consumerKey` string
    - `username` string
    - `fullName` string
    - `email` string
    - `description` string
    - `enabled` boolean
    - `organizationCode` string
    - `expireDate` string, date-time
    - `trafficLogDisabled` boolean
    - `ipList` string[]
    - `roleNames` string[]
    - `metadata` CredentialMetadataDTO[]
      - `key` string
      - `value` string
      - `secret` boolean
      - `includeInJwt` boolean
      - `includeInTokenResponse` boolean
      - `jwtClaimName` string

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
