Documentation menu

Member types

The kinds of member you define for the environment (people, bots, automations), each with a cap per member each calendar month and the models it may use.

OperationMethodSDK
List member typesGEThixel.memberTypes.list
Create or replace a member typePUThixel.memberTypes.put
Remove a member typeDELETEhixel.memberTypes.remove

List member types#

GET/v1/member_typeshixel.memberTypes.list

Every member type of the environment, by key; member is always among them, with no cap and no models while you have not set them.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Response 200: MemberTypeList

FieldTypeDescription
data requiredarray of MemberType
data[].key requiredstringA lowercase letter, then up to 31 lowercase letters, digits or _: what x-hixel-member-type sends.
data[].name requiredstringA display name, 1 to 64 characters.
data[].budget_micros requiredTypeBudgetMicros | nullThe most each member of the type may spend per calendar month (UTC), whatever its customer sets; null for no cap from the type.
data[].allowed_models requiredarray of string | nullModel names and prefix/* patterns members of the type may use, within the environment's; null restricts nothing.
data[].updated_at requiredstring | nullWhen it last changed; null for the type member while it has no settings.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • environment_required: a project key was sent without x-hixel-environment.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/member_types" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Create or replace a member type#

PUT/v1/member_types/{key}hixel.memberTypes.put

Creates the type key (201) or replaces its settings (200), and publishes it to the gateway. An environment has at most 20 types (member_types_limit_reached). Takes a project key with the admin role and x-hixel-environment, as changing the gateway settings does.

Takes a project key with the admin role, naming the environment in x-hixel-environment; an environment's own key may not. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
key requiredpathstringThe member type's key.

Request body: PutMemberTypeBody

FieldTypeDescription
name requiredstringA display name, 1 to 64 characters.
budget_microsTypeBudgetMicros | nullThe cap per member each calendar month (UTC); null or left out for none.
allowed_modelsarray of string | nullUp to 256 model names and prefix/* patterns; null or left out restricts nothing.

Response 200, 201: MemberType

200: The type existed and was replaced. 201: The type was created.

FieldTypeDescription
key requiredstringA lowercase letter, then up to 31 lowercase letters, digits or _: what x-hixel-member-type sends.
name requiredstringA display name, 1 to 64 characters.
budget_micros requiredTypeBudgetMicros | nullThe most each member of the type may spend per calendar month (UTC), whatever its customer sets; null for no cap from the type.
allowed_models requiredarray of string | nullModel names and prefix/* patterns members of the type may use, within the environment's; null restricts nothing.
updated_at requiredstring | nullWhen it last changed; null for the type member while it has no settings.

Errors

  • 400
    • invalid_parameter: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: the project key was sent without x-hixel-environment.
    • invalid_params, invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the project key was revoked or expired while the request ran.
    • project_key_required: an environment's key was sent; this endpoint takes a project key.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, or an archived one.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • member_types_limit_reached: The environment has the most member types it may (20). Remove one first.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X PUT "https://api.hixel.dev/v1/member_types/key_123" \
  -H "Authorization: Bearer $HIXEL_PROJECT_KEY" \
  -H "x-hixel-environment: env_123" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Inc."
  }'

Remove a member type#

DELETE/v1/member_types/{key}hixel.memberTypes.remove

Removes the type key, refused while a member row or a customer's default budget names it (member_type_in_use). Removing member returns it to no cap and no models. Answers 204 with no body. Takes a project key with the admin role.

Takes a project key with the admin role, naming the environment in x-hixel-environment; an environment's own key may not. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
key requiredpathstringThe member type's key.

Response 204

No body.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: the project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the project key was revoked or expired while the request ran.
    • project_key_required: an environment's key was sent; this endpoint takes a project key.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • member_type_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, or an archived one.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • member_type_in_use: A member or a customer's default budget still names this member type. Change them first.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X DELETE "https://api.hixel.dev/v1/member_types/key_123" \
  -H "Authorization: Bearer $HIXEL_PROJECT_KEY" \
  -H "x-hixel-environment: env_123"