Skip to main content

CustomAttribute

A user-declared attribute key, the resource scope where it applies, and whether it is required.

Custom attributes enforce consistent metadata across your organization. When a custom attribute is marked as required, any resource created at the specified scope must include the attribute key. Optional custom attributes define allowed keys without mandating them.

System attributes (md-*) are auto-injected by Massdriver and are not declared here — only user-defined keys live in this list.

Use the customAttributeSchema query to generate a JSON Schema document narrowed to the values your policies permit for a given action — useful for client-side validation that mirrors what the API will accept on write. Use customAttributeValues to fetch just the closed set for a single key.

Example: A custom attribute with key: "TEAM", scope: PROJECT, required: true means every project must have a TEAM attribute set at creation time.

type CustomAttribute {
id: ID!
key: String!
scope: AttributeScope!
required: Boolean!
values: [String!]!
createdAt: DateTime!
updatedAt: DateTime!
}

Fields

CustomAttribute.id ● ID! non-null scalar {#id}

Unique identifier for this custom attribute.

CustomAttribute.key ● String! non-null scalar {#key}

The attribute key name (e.g., TEAM, COST_CENTER, DOMAIN). Case-sensitive.

CustomAttribute.scope ● AttributeScope! non-null enum {#scope}

The resource level where this attribute must or may be set.

CustomAttribute.required ● Boolean! non-null scalar {#required}

When true, resources created at the specified scope must include this attribute. When false, the attribute is allowed but optional.

CustomAttribute.values ● [String!]! non-null scalar {#values}

The closed set of values this attribute may take. Resource attribute writes and policy conditions referencing this key must use one of these values.

CustomAttribute.createdAt ● DateTime! non-null scalar {#created-at}

When this custom attribute was created (UTC).

CustomAttribute.updatedAt ● DateTime! non-null scalar {#updated-at}

When this custom attribute was last modified (UTC).

Member Of

CustomAttributePayload object ● CustomAttributesPage object