Skip to main content
POST
cURL

Body

application/json
scope
enum<string>
required

global creates a variable services can use, which needs the admin role. personal creates one of your own, which only your personal values can use.

Available options:
global,
personal
key
string
required

The name values use to refer to the variable, as {{KEY}}. Starts with a letter and uses only upper case letters, numbers and underscores.

Required string length: 1 - 64
Pattern: ^[A-Z][A-Z0-9_]*$
projectId
string

The ID of the Agent Vault project.

Required string length: 1 - 36
type
enum<string>
default:text

text (the default) for a value services put in place of {{KEY}}. oauth for a sign-in with an OAuth provider, which needs oauth. OAuth variables are always global and count toward the project's limit of 500 global variables.

Available options:
text,
oauth
value
string

The value the proxy puts in place of each {{KEY}}. Required for a text variable; leave it out for an oauth one.

Required string length: 1 - 8192
Pattern: ^[^\x00-\x1f\x7f]*$
oauth
object

The OAuth provider. Send serverUrl for Infisical to discover its endpoints at each sign-in, or authorizationEndpoint, tokenEndpoint, clientId and scopes to set it up by hand.

tokens
object

Tokens you already hold, for an OAuth variable set up by hand. They are stored as sent, replacing any the variable held, and first checked when a service uses them.

signIn
object

Start a sign-in as the variable is created. The response then carries signIn, with the link to send the user to. Leave it out to start one later.

Response

Default Response

variable
object
required
signIn
object | null
required

The sign-in started with the variable, or null when none was asked for. Its authorization is null when the variable needs more settings first.

signInError
string

Present only when signIn was sent and the variable was created but its sign-in couldn't be started. signIn is then null: start a new sign-in for the variable.