Mutation
mutation UpsertAccount($input: UpsertAccountInput!) {
upsertAccount(input: $input) {
account {
id
name
externalId
url
source
tier {
id
name
externalId
color
isDefault
defaultPriority
}
}
result
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"identifier": {},
"name": "string",
"externalId": "string"
}
}Response
{
"data": {
"upsertAccount": {
"account": {
"id": "id",
"name": "string",
"externalId": "string",
"url": "string",
"source": "API",
"tier": {
"id": "id",
"name": "string",
"externalId": "string",
"color": "string",
"isDefault": true,
"defaultPriority": 1
}
},
"result": "UPDATED",
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
upsertAccount
Creates a new account or updates an existing one identified by externalId or accountId.
Use this to keep Plain’s account records in sync with the groups or organisations in your own product.
The result field on the output indicates whether a record was created or updated.
Requires the tenant:create and tenant:edit permissions.
MUTATION
upsertAccount(input: UpsertAccountInput!): UpsertAccountOutput!Arguments
input
required
Returns
account
result
error
Mutation
mutation UpsertAccount($input: UpsertAccountInput!) {
upsertAccount(input: $input) {
account {
id
name
externalId
url
source
tier {
id
name
externalId
color
isDefault
defaultPriority
}
}
result
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"identifier": {},
"name": "string",
"externalId": "string"
}
}Response
{
"data": {
"upsertAccount": {
"account": {
"id": "id",
"name": "string",
"externalId": "string",
"url": "string",
"source": "API",
"tier": {
"id": "id",
"name": "string",
"externalId": "string",
"color": "string",
"isDefault": true,
"defaultPriority": 1
}
},
"result": "UPDATED",
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

