cURL
curl --request PATCH \
--url https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
{
"role": "<string>",
"isTemporary": false
}
]
}
'import requests
url = "https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}"
payload = { "roles": [
{
"role": "<string>",
"isTemporary": False
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roles: [{role: '<string>', isTemporary: false}]})
};
fetch('https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'roles' => [
[
'role' => '<string>',
'isTemporary' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}"
payload := strings.NewReader("{\n \"roles\": [\n {\n \"role\": \"<string>\",\n \"isTemporary\": false\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"roles\": [\n {\n \"role\": \"<string>\",\n \"isTemporary\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"roles\": [\n {\n \"role\": \"<string>\",\n \"isTemporary\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"roles": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"projectMembershipId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"customRoleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isTemporary": false,
"temporaryMode": "<string>",
"temporaryRange": "<string>",
"temporaryAccessStartTime": "2023-11-07T05:31:56Z",
"temporaryAccessEndTime": "2023-11-07T05:31:56Z"
}
]
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Legacy
Update User Membership
Update project user membership
PATCH
/
api
/
v1
/
workspace
/
{workspaceId}
/
memberships
/
{membershipId}
cURL
curl --request PATCH \
--url https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
{
"role": "<string>",
"isTemporary": false
}
]
}
'import requests
url = "https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}"
payload = { "roles": [
{
"role": "<string>",
"isTemporary": False
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roles: [{role: '<string>', isTemporary: false}]})
};
fetch('https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'roles' => [
[
'role' => '<string>',
'isTemporary' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}"
payload := strings.NewReader("{\n \"roles\": [\n {\n \"role\": \"<string>\",\n \"isTemporary\": false\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"roles\": [\n {\n \"role\": \"<string>\",\n \"isTemporary\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v1/workspace/{workspaceId}/memberships/{membershipId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"roles\": [\n {\n \"role\": \"<string>\",\n \"isTemporary\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"roles": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"projectMembershipId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"customRoleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isTemporary": false,
"temporaryMode": "<string>",
"temporaryRange": "<string>",
"temporaryAccessStartTime": "2023-11-07T05:31:56Z",
"temporaryAccessEndTime": "2023-11-07T05:31:56Z"
}
]
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Authorizations
An access token in Infisical
Path Parameters
The ID of the project to update the membership for.
The ID of the membership to update.
Body
application/json
A list of roles to update the membership to.
Minimum array length:
1- Option 1
- Option 2
Show child attributes
Show child attributes
Response
Default Response
Show child attributes
Show child attributes
Was this page helpful?
⌘I