---
title: "POST /api/v1/projects/{projectId}/memberships/identities/{identityId}"
method: POST
path: "/api/v1/projects/{projectId}/memberships/identities/{identityId}"
tags: ["Project Identities"]
---

# POST /api/v1/projects/{projectId}/memberships/identities/{identityId}

`POST /api/v1/projects/{projectId}/memberships/identities/{identityId}`

## Request

- Base URL: `https://us.infisical.com`
- URL: `https://us.infisical.com/api/v1/projects/{projectId}/memberships/identities/{identityId}`
- Auth: HTTP bearer

Create project identity membership

## Path parameters

- `projectId` string, required
- `identityId` string, required

## Request body

- object
  - `role` string
  - `roles` union[]: A list of role slugs to assign to the newly created identity project membership.
    - union
      - object
        - `role` string, required: The role slug to assign to the newly created identity project membership.
        - `isTemporary` false: The role slug to assign to the newly created identity project membership.
      - object
        - `role` string, required: The role slug to assign to the newly created identity project membership.
        - `isTemporary` true, required: The role slug to assign to the newly created identity project membership.
        - `temporaryMode` 'relative', required: The role slug to assign to the newly created identity project membership.
        - `temporaryRange` string, required: The role slug to assign to the newly created identity project membership.
        - `temporaryAccessStartTime` string, date-time, required: The role slug to assign to the newly created identity project membership.

## Response `200`

Default Response

- object
  - `identityMembership` object, required
    - `id` string, uuid, required
    - `projectId` string, required
    - `identityId` string, uuid, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `403`: Default Response
- `404`: Default Response
- `422`: Default Response
- `500`: Default Response

---

[API](https://skmtc.dev/infisical/apis/infisical-api.md) - [All operations](https://skmtc.dev/infisical/apis/infisical-api/llms.txt) - [OpenAPI document](https://skmtc.dev/infisical/apis/infisical-api/revisions/7f940199c899?raw)
