Users
user
#
A user is the people side of Raindrop — who's signed in, who they report to, what role they're playing today. Read users to power sign-in flows, org charts, and approval routing. Write to invite teammates and update profiles.
Filter any list query with where: over the same columns — see the Read example below.
Read & query
List users
curl https://${RAINDROP_API_HOST}/gql \
-H "Authorization: Bearer ${RAINDROP_API_KEY}" \
-H "Content-Type: application/json" \
--data-raw '{"query":"query ListUser {\n user(limit: 10) {\n id\n account\n billing_admin\n budgetary_approval\n }\n}"}'
const r = await fetch("https://${RAINDROP_API_HOST}/gql", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RAINDROP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query ListUser {
user(limit: 10) {
id
account
billing_admin
budgetary_approval
}
}`,
}),
});
const { data } = await r.json();
import os, requests
r = requests.post(
"https://${RAINDROP_API_HOST}/gql",
headers={"Authorization": f"Bearer {os.environ['RAINDROP_API_KEY']}"},
json={
"query": """query ListUser {
user(limit: 10) {
id
account
billing_admin
budgetary_approval
}
}""",
},
)
data = r.json()["data"]
payload, _ := json.Marshal(map[string]any{
"query": `query ListUser {
user(limit: 10) {
id
account
billing_admin
budgetary_approval
}
}`,
})
req, _ := http.NewRequest("POST", "https://${RAINDROP_API_HOST}/gql", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RAINDROP_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"data": {
"user": [
{
"account": "example",
"billing_admin": true,
"budgetary_approval": 1,
"id": 1
},
{
"account": "example",
"billing_admin": true,
"budgetary_approval": 1,
"id": 2
}
]
}
}
Get one by id
curl https://${RAINDROP_API_HOST}/gql \
-H "Authorization: Bearer ${RAINDROP_API_KEY}" \
-H "Content-Type: application/json" \
--data-raw '{"query":"query GetUser($id: Int!) {\n user(where: {id: {_eq: $id}}) {\n id\n account\n billing_admin\n budgetary_approval\n }\n}","variables":{"id":1}}'
const r = await fetch("https://${RAINDROP_API_HOST}/gql", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RAINDROP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query GetUser($id: Int!) {
user(where: {id: {_eq: $id}}) {
id
account
billing_admin
budgetary_approval
}
}`,
variables: {
"id": 1
},
}),
});
const { data } = await r.json();
import os, requests
r = requests.post(
"https://${RAINDROP_API_HOST}/gql",
headers={"Authorization": f"Bearer {os.environ['RAINDROP_API_KEY']}"},
json={
"query": """query GetUser($id: Int!) {
user(where: {id: {_eq: $id}}) {
id
account
billing_admin
budgetary_approval
}
}""",
"variables": {
"id": 1
},
},
)
data = r.json()["data"]
payload, _ := json.Marshal(map[string]any{
"query": `query GetUser($id: Int!) {
user(where: {id: {_eq: $id}}) {
id
account
billing_admin
budgetary_approval
}
}`,
"variables": {
"id": 1
},
})
req, _ := http.NewRequest("POST", "https://${RAINDROP_API_HOST}/gql", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RAINDROP_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"data": {
"user": [
{
"account": "example",
"billing_admin": true,
"budgetary_approval": 1,
"id": 1
}
]
}
}
Create
Insert a user
curl https://${RAINDROP_API_HOST}/gql \
-H "Authorization: Bearer ${RAINDROP_API_KEY}" \
-H "Content-Type: application/json" \
--data-raw '{"query":"mutation CreateUser($object: user_insert_input!) {\n insert_user_one(object: $object) {\n id\n account\n billing_admin\n budgetary_approval\n }\n}","variables":{"object":{"account":"example","billing_admin":true,"budgetary_approval":1}}}'
const r = await fetch("https://${RAINDROP_API_HOST}/gql", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RAINDROP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation CreateUser($object: user_insert_input!) {
insert_user_one(object: $object) {
id
account
billing_admin
budgetary_approval
}
}`,
variables: {
"object": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1
}
},
}),
});
const { data } = await r.json();
import os, requests
r = requests.post(
"https://${RAINDROP_API_HOST}/gql",
headers={"Authorization": f"Bearer {os.environ['RAINDROP_API_KEY']}"},
json={
"query": """mutation CreateUser($object: user_insert_input!) {
insert_user_one(object: $object) {
id
account
billing_admin
budgetary_approval
}
}""",
"variables": {
"object": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1
}
},
},
)
data = r.json()["data"]
payload, _ := json.Marshal(map[string]any{
"query": `mutation CreateUser($object: user_insert_input!) {
insert_user_one(object: $object) {
id
account
billing_admin
budgetary_approval
}
}`,
"variables": {
"object": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1
}
},
})
req, _ := http.NewRequest("POST", "https://${RAINDROP_API_HOST}/gql", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RAINDROP_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"data": {
"insert_user_one": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1,
"id": 1
}
}
}
Update
Update a user
curl https://${RAINDROP_API_HOST}/gql \
-H "Authorization: Bearer ${RAINDROP_API_KEY}" \
-H "Content-Type: application/json" \
--data-raw '{"query":"mutation UpdateUser($id: Int!, $changes: user_set_input!) {\n update_user(where: {id: {_eq: $id}}, _set: $changes) {\n affected_rows\n returning {\n id\n account\n billing_admin\n budgetary_approval\n }\n }\n}","variables":{"changes":{"account":"example","billing_admin":true,"budgetary_approval":1},"id":1}}'
const r = await fetch("https://${RAINDROP_API_HOST}/gql", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RAINDROP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `mutation UpdateUser($id: Int!, $changes: user_set_input!) {
update_user(where: {id: {_eq: $id}}, _set: $changes) {
affected_rows
returning {
id
account
billing_admin
budgetary_approval
}
}
}`,
variables: {
"changes": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1
},
"id": 1
},
}),
});
const { data } = await r.json();
import os, requests
r = requests.post(
"https://${RAINDROP_API_HOST}/gql",
headers={"Authorization": f"Bearer {os.environ['RAINDROP_API_KEY']}"},
json={
"query": """mutation UpdateUser($id: Int!, $changes: user_set_input!) {
update_user(where: {id: {_eq: $id}}, _set: $changes) {
affected_rows
returning {
id
account
billing_admin
budgetary_approval
}
}
}""",
"variables": {
"changes": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1
},
"id": 1
},
},
)
data = r.json()["data"]
payload, _ := json.Marshal(map[string]any{
"query": `mutation UpdateUser($id: Int!, $changes: user_set_input!) {
update_user(where: {id: {_eq: $id}}, _set: $changes) {
affected_rows
returning {
id
account
billing_admin
budgetary_approval
}
}
}`,
"variables": {
"changes": {
"account": "example",
"billing_admin": true,
"budgetary_approval": 1
},
"id": 1
},
})
req, _ := http.NewRequest("POST", "https://${RAINDROP_API_HOST}/gql", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RAINDROP_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"data": {
"update_user": {
"affected_rows": 1,
"returning": [
{
"account": "example",
"billing_admin": true,
"budgetary_approval": 1,
"id": 1
}
]
}
}
}