You are here

public function Clients::create in Auth0 Single Sign On 8.2

Create a new Client. Required scope: "create:clients"

@link https://auth0.com/docs/api/management/v2#!/Clients/post_clients

Parameters

array $data Client create data; "name" field is required.:

Return value

mixed|string

Throws

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/src/API/Management/Clients.php, line 133

Class

Clients
Class Clients. Handles requests to the Clients endpoint of the v2 Management API.

Namespace

Auth0\SDK\API\Management

Code

public function create(array $data) {
  if (empty($data['name'])) {
    throw new \Exception('Missing required "name" field.');
  }
  return $this->apiClient
    ->method('post')
    ->addPath('clients')
    ->withBody(json_encode($data))
    ->call();
}