curl --request POST \
--url https://api.1password.com/v1/accounts/{account}/users/{user}:suspend \
--header 'Authorization: Bearer <token>'const url = 'https://api.1password.com/v1/accounts/{account}/users/{user}:suspend';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.1password.com/v1/accounts/{account}/users/{user}:suspend"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.1password.com/v1/accounts/{account}/users/{user}:suspend"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api.1password.com/v1/accounts/{account}/users/{user}:suspend");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.1password.com/v1/accounts/{account}/users/{user}:suspend")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1password.com/v1/accounts/{account}/users/{user}:suspend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$response = Invoke-WebRequest -Uri 'https://api.1password.com/v1/accounts/{account}/users/{user}:suspend' -Method POST -Headers $headersrequire 'uri'
require 'net/http'
url = URI("https://api.1password.com/v1/accounts/{account}/users/{user}:suspend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "IR7VJHJ36JHINBFAD7V2T5MP3E",
"email": "wendy_appleseed@agilebits.com",
"display_name": "Wendy Appleseed",
"state": "SUSPENDED",
"create_time": "2024-01-15T10:30:00Z",
"path": "accounts/WX52YXL2MVEPBK43P3R4XMWKXI/users/IR7VJHJ36JHINBFAD7V2T5MP3E"
}Suspend a user
Suspend a user in a 1Password account.
curl --request POST \
--url https://api.1password.com/v1/accounts/{account}/users/{user}:suspend \
--header 'Authorization: Bearer <token>'const url = 'https://api.1password.com/v1/accounts/{account}/users/{user}:suspend';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.1password.com/v1/accounts/{account}/users/{user}:suspend"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.1password.com/v1/accounts/{account}/users/{user}:suspend"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api.1password.com/v1/accounts/{account}/users/{user}:suspend");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.1password.com/v1/accounts/{account}/users/{user}:suspend")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1password.com/v1/accounts/{account}/users/{user}:suspend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$response = Invoke-WebRequest -Uri 'https://api.1password.com/v1/accounts/{account}/users/{user}:suspend' -Method POST -Headers $headersrequire 'uri'
require 'net/http'
url = URI("https://api.1password.com/v1/accounts/{account}/users/{user}:suspend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "IR7VJHJ36JHINBFAD7V2T5MP3E",
"email": "wendy_appleseed@agilebits.com",
"display_name": "Wendy Appleseed",
"state": "SUSPENDED",
"create_time": "2024-01-15T10:30:00Z",
"path": "accounts/WX52YXL2MVEPBK43P3R4XMWKXI/users/IR7VJHJ36JHINBFAD7V2T5MP3E"
}ACTIVE to SUSPENDED, and their access to the account is removed. A successful request returns the updated user with the state set to SUSPENDED.
The :suspend action is idempotent. Using this action on a user who is already suspended returns the user with no changes to their state.
Only active users can be suspended. Suspending a user who is in another state, such as pending confirmation, returns 400 Bad Request with the failed_precondition code and the message user_not_suspendable.
This endpoint doesn’t accept a request body.
Restrictions
The following users can’t be suspended from a 1Password account:- People in the External Account Managers group.
- The last remaining owner of an account. Attempting to suspend the last owner returns
403 Forbiddenwith the messageCannot suspend user: no_owner_remain.
Authorizations
OAuth 2.0 access token authentication. Request an access token from the OAuth token endpoint using the client credentials for the OAuth application in your 1Password account, then include it in the Authorization header of every request as Bearer <token>. Access tokens expire after 15 minutes (900 seconds).
Headers
An identifiable user agent for your integration, in the format <CompanyOrProductName>/<version>, so requests can be attributed to a specific integration for support, troubleshooting, and usage analytics.
Path Parameters
The unique identifier of the 1Password account, a 26-character uppercase ID. A malformed ID returns 400 Bad Request.
26The unique identifier of the user, a 26-character uppercase ID. A malformed ID returns 400 Bad Request.
26Response
The updated user, with state SUSPENDED.
A user within a 1Password account.
The unique identifier (UUID) of the user.
The email address of the user.
The display name of the user.
The current state of the user. Omitted when the user is neither active nor suspended, for example while pending confirmation or in account recovery.
STATE_UNSPECIFIED, ACTIVE, SUSPENDED The date and time the user was created, in RFC 3339 format.
The resource path of the user.
Format: accounts/{account}/users/{user}
Was this page helpful?