Schemas: insert

Requires authorization

Create schema. Try it now.

Request

HTTP request

POST https://www.googleapis.com/admin/directory/v1/customer/customerId/schemas

Parameters

Parameter name Value Description
Path parameters
customerId string Immutable ID of the G Suite account.

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/admin.directory.userschema

Request body

In the request body, supply a Schemas resource with the following properties:

Property name Value Description Notes
Required Properties
fields[] list A list of fields in the schema. writable
fields[].fieldName string The name of the field. writable
fields[].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.
writable
schemaName string The schema's name. writable
Optional Properties
fields[].indexed boolean Boolean specifying whether the field is indexed or not. Default: true. writable
fields[].multiValued boolean A boolean specifying whether this is a multi-valued field or not. Default: false. writable
fields[].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. writable
fields[].numericIndexingSpec.maxValue double 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. writable
fields[].numericIndexingSpec.minValue double 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. writable
fields[].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"
  • "ALL_DOMAIN_USERS"
writable

Response

If successful, this method returns a Schemas resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Send feedback about...

Directory API
Directory API