class Stytch::M2M::Clients

def create(

The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +M2MClientWithClientSecret+ (+object+).
The M2M Client created by this API call.
m2m_client::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is nilable +object+.
The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
trusted_metadata::
The type of this field is nilable +String+.
A human-readable description for the client.
client_description::
The type of this field is nilable +String+.
A human-readable name for the client.
client_name::
The type of this field is nilable +String+.
If provided, the stored secret of the client to create. If not provided, Stytch will generate this value for you. If provided, the `client_secret` must be at least 8 characters long and pass entropy requirements.
client_secret::
The type of this field is nilable +String+.
If provided, the ID of the client to create. If not provided, Stytch will generate this value for you. The `client_id` must be unique within your project.
client_id::
The type of this field is list of +String+.
An array of scopes assigned to the client.
scopes::
== Parameters:

**Important:** This is the only time you will be able to view the generated `client_secret` in the API response. Stytch stores a hash of the `client_secret` and cannot recover the value if lost. Be sure to persist the `client_secret` in a secure location. If the `client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.

Creates a new M2M Client. On initial client creation, you may pass in a custom `client_id` or `client_secret` to import an existing M2M client. If you do not pass in a custom `client_id` or `client_secret`, one will be generated automatically. The `client_id` must be unique among all clients in your project.
def create(
  scopes:,
  client_id: nil,
  client_secret: nil,
  client_name: nil,
  client_description: nil,
  trusted_metadata: nil
)
  headers = {}
  request = {
    scopes: scopes
  }
  request[:client_id] = client_id unless client_id.nil?
  request[:client_secret] = client_secret unless client_secret.nil?
  request[:client_name] = client_name unless client_name.nil?
  request[:client_description] = client_description unless client_description.nil?
  request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
  post_request('/v1/m2m/clients', request, headers)
end