REST Resource: schemas

Resource: Schema

The type of API resource. For Schema resources, this is always admin#directory#schema.

JSON representation
{
  "schemaId": string,
  "schemaName": string,
  "fields": [
    {
      object (SchemaFieldSpec)
    }
  ],
  "displayName": string,
  "kind": string,
  "etag": string
}
Fields
schemaId

string

The unique identifier of the schema (Read-only)

schemaName

string

The schema's name.

Each schemaName must be unique within a customer. Reusing a name results in a 409: Entity already exists error.

fields[]

object (SchemaFieldSpec)

A list of fields in the schema.

displayName

string

Display name for the schema.

kind

string

Kind of resource this is.

etag

string

The ETag of the resource.

SchemaFieldSpec

You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see Custom User Fields.

JSON representation
{
  "fieldName": string,
  "fieldId": string,
  "fieldType": string,
  "multiValued": boolean,
  "kind": string,
  "etag": string,
  "indexed": boolean,
  "displayName": string,
  "readAccessType": string,
  "numericIndexingSpec": {
    "minValue": number,
    "maxValue": number
  }
}
Fields
fieldName

string

The name of the field.

fieldId

string

The unique identifier of the field (Read-only)

fieldType

string

The type of the field.

Acceptable values are:

  • BOOL: Boolean values.
  • DATE: Dates in ISO-8601 format.
  • DOUBLE: Double-precision floating-point values.
  • EMAIL: Email addresses.
  • INT64: 64-bit integer values.
  • PHONE: Phone numbers.
  • STRING: String values.
multiValued

boolean

A boolean specifying whether this is a multi-valued field or not. Default: false.

kind

string

The kind of resource this is. For schema fields this is always admin#directory#schema#fieldspec.

etag

string

The ETag of the field.

indexed

boolean

Boolean specifying whether the field is indexed or not. Default: true.

displayName

string

Display Name of the field.

readAccessType

string

Specifies who can view values of this field. See Retrieve users as a non-administrator for more information.

Note: It may take up to 24 hours for changes to this field to be reflected.

Acceptable values are:

  • ADMINS_AND_SELF: Only administrators and the associated user can see values.
  • ALL_DOMAIN_USERS: Any user in your domain can see values.
numericIndexingSpec

object

Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the numericIndexingSpec allows range queries to be supported.

numericIndexingSpec.minValue

number

Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.

numericIndexingSpec.maxValue

number

Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.

Methods

delete

Deletes a schema.

get

Retrieves a schema.

insert

Creates a schema.

list

Retrieves all schemas for a customer.

patch

Patches a schema.

update

Updates a schema.