---
title: "Grant access to a consumer"
method: POST
path: "/apiops/projects/{projectName}/consumers/{consumerKey}/access"
tags: ["Consumer"]
---

# Grant access to a consumer

`POST /apiops/projects/{projectName}/consumers/{consumerKey}/access`

## Request

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

Grants every listed API proxy / API proxy group of the project (accessList, each with name, type API_PROXY or API_PROXY_GROUP and an optional expireTime; optionally environments [{environmentName, enabled}], disallowedEndpoints [{name, httpMethod}] on an API proxy and disallowedApiProxies [name] on a group — all by name, an unknown one is 404). An unknown target is 404; a target already granted is 409 lifecycleConflict (reason accessAlreadyGranted) — nothing is silently skipped. Targets are applied in order: a refusal leaves the targets before it granted, so a retry should send only the remaining ones.

## Path parameters

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

## Request body

- ApiOpsConsumerAccessListDTO
  - `accessList` ApiOpsConsumerAccessDTO[]
    - `name` string
    - `type` 'API_PROXY' | 'API_PROXY_GROUP'
    - `expireTime` string, date-time: Optional expiration time for the access grant
    - `environments` Environment[]: Environments of the project and whether the row may be called there. On a write, a listed environment is set; an unlisted one keeps its stored value (a new grant: enabled).
      - `name` string
      - `acknowledged` boolean
      - `detail` string
    - `disallowedEndpoints` ApiProxyEndpointIdentifierDTO[]: API_PROXY rows only: endpoints (name = REST path or SOAP operation, httpMethod) the consumer may not call. On a write, a sent list replaces the stored one.
      - `name` string
      - `httpMethod` 'GET' | 'POST' | 'PUT' | 'HEAD' | 'OPTIONS' | 'DELETE' | 'PATCH' | 'TRACE' | 'ALL' | 'QUERY'
    - `disallowedApiProxies` string[]: API_PROXY_GROUP rows only: names of the group's API proxies the consumer may not call. On a write, a sent list replaces the stored one.

## Response `200`

OK

- ApiOpsMutationResponseListApiOpsConsumerAccessDTO
  - `status` 'SUCCESS' | 'FAILURE'
  - `resourceVersion` integer
  - `runtimeDeployment` ApiOpsRuntimeDeploymentDTO
    - `state` 'IN_SYNC' | 'DEGRADED'
    - `environments` Environment[]
      - `name` string
      - `acknowledged` boolean
      - `detail` string
  - `result` ApiOpsConsumerAccessDTO[]
    - `name` string
    - `type` 'API_PROXY' | 'API_PROXY_GROUP'
    - `expireTime` string, date-time: Optional expiration time for the access grant
    - `environments` Environment[]: Environments of the project and whether the row may be called there. On a write, a listed environment is set; an unlisted one keeps its stored value (a new grant: enabled).
      - `name` string
      - `acknowledged` boolean
      - `detail` string
    - `disallowedEndpoints` ApiProxyEndpointIdentifierDTO[]: API_PROXY rows only: endpoints (name = REST path or SOAP operation, httpMethod) the consumer may not call. On a write, a sent list replaces the stored one.
      - `name` string
      - `httpMethod` 'GET' | 'POST' | 'PUT' | 'HEAD' | 'OPTIONS' | 'DELETE' | 'PATCH' | 'TRACE' | 'ALL' | 'QUERY'
    - `disallowedApiProxies` string[]: API_PROXY_GROUP rows only: names of the group's API proxies the consumer may not call. On a write, a sent list replaces the stored one.

---

[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)
