> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Create a user

POST https://api.getpostman.com/scim/v2/Users
Content-Type: application/json

Creates a new user account in Postman and adds the user to your organization's Postman team.
- If the account does not exist, this also activates the user so they can authenticate in to your Postman team.
- If an account matching the email ID exists, the user receives [email invite](https://learning.postman.com/docs/administration/managing-your-team/manage-team-members/#manage-invites) to join the Postman team. The user joins the team when they accept the invite.
- If the user's email domain matches your team's verified domains, the user is immediately added to the team.

By default, the system assigns new users the developer role. You can [update user roles in Postman](https://learning.postman.com/docs/administration/managing-your-team/manage-team-members/#manage-team-roles).

**Note:**

- Users must join the team before you can assign them to any groups.
- If the user is a member of a different team during SCIM provisioning and their email domain is **not** verified with your Postman team, then the user is **not** provisioned. The endpoint returns an HTTP `409 Conflict` response.


Reference: https://learning.postman.com/api-docs/api-reference/scim/create-scim-user

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /scim/v2/Users:
    post:
      operationId: createScimUser
      summary: Create a user
      description: >
        Creates a new user account in Postman and adds the user to your
        organization's Postman team.

        - If the account does not exist, this also activates the user so they
        can authenticate in to your Postman team.

        - If an account matching the email ID exists, the user receives [email
        invite](https://learning.postman.com/docs/administration/managing-your-team/manage-team-members/#manage-invites)
        to join the Postman team. The user joins the team when they accept the
        invite.

        - If the user's email domain matches your team's verified domains, the
        user is immediately added to the team.


        By default, the system assigns new users the developer role. You can
        [update user roles in
        Postman](https://learning.postman.com/docs/administration/managing-your-team/manage-team-members/#manage-team-roles).


        **Note:**


        - Users must join the team before you can assign them to any groups.

        - If the user is a member of a different team during SCIM provisioning
        and their email domain is **not** verified with your Postman team, then
        the user is **not** provisioned. The endpoint returns an HTTP `409
        Conflict` response.
      tags:
        - scim
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createScimUserResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimErrorScimType'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimErrorScimType'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createScimUser'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    CreateScimUserName:
      type: object
      properties:
        givenName:
          type: string
          description: The user's first name.
        familyName:
          type: string
          description: The user's last name.
      description: Information about the user's name.
      title: CreateScimUserName
    createScimUser:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          description: >-
            The [SCIM schema
            URI](https://www.iana.org/assignments/scim/scim.xhtml).
        userName:
          type: string
          description: The user's username.
        active:
          type: boolean
          description: >-
            If true, activates the user. This lets them authenticate in to your
            Postman team.
        externalId:
          type: string
          description: The user's external ID.
        groups:
          type: array
          items:
            type: string
          description: A list of groups to assign the user to.
        locale:
          type: string
          description: >-
            The user's [IETF language
            tag](https://datatracker.ietf.org/doc/html/rfc5646).
        name:
          $ref: '#/components/schemas/CreateScimUserName'
          description: Information about the user's name.
      title: createScimUser
    CreateScimUserResponseName:
      type: object
      properties:
        givenName:
          type: string
          description: The user's first name.
        familyName:
          type: string
          description: The user's last name.
      title: CreateScimUserResponseName
    CreateScimUserResponseMetaResourceType:
      type: string
      enum:
        - User
      description: The SCIM resource type.
      title: CreateScimUserResponseMetaResourceType
    CreateScimUserResponseMeta:
      type: object
      properties:
        created:
          type: string
          format: date-time
          description: The date and time at which the user was created.
        lastModified:
          type: string
          format: date-time
          description: The date and time at which the user was last modified.
        resourceType:
          $ref: '#/components/schemas/CreateScimUserResponseMetaResourceType'
          description: The SCIM resource type.
      description: The response's non-standard meta information.
      title: CreateScimUserResponseMeta
    createScimUserResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          description: >-
            The [SCIM schema
            URI](https://www.iana.org/assignments/scim/scim.xhtml).
        id:
          type: string
          description: The user's SCIM ID.
        userName:
          type: string
          format: email
          description: The user's username.
        name:
          $ref: '#/components/schemas/CreateScimUserResponseName'
        externalId:
          type: string
          description: The user's external ID.
        active:
          type: boolean
          description: If true, the user is active.
        meta:
          $ref: '#/components/schemas/CreateScimUserResponseMeta'
          description: The response's non-standard meta information.
      title: createScimUserResponse
    scimErrorScimType:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          description: >-
            The [SCIM schema
            URI](https://www.iana.org/assignments/scim/scim.xhtml).
        scimType:
          type: string
          description: The SCIM error type.
        detail:
          type: string
          description: Information about the error.
        status:
          type: string
          format: http-status-code
          description: The HTTP status code.
      title: scimErrorScimType
    scimError:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          description: >-
            The [SCIM schema
            URI](https://www.iana.org/assignments/scim/scim.xhtml).
        detail:
          type: string
          description: Information about the error.
        status:
          type: string
          format: http-status-code
          description: The HTTP status code.
      title: scimError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### SCIM User Created



**Request**

```json
undefined
```

**Response**

```json
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "405775fe15ed41872a8eea4c8aa2b38cda9749812cc55c99",
  "userName": "taylor.lee@example.com",
  "name": {
    "givenName": "Test",
    "familyName": "User"
  },
  "externalId": "12345678",
  "active": true,
  "meta": {
    "created": "2021-02-22T04:24:13.000Z",
    "lastModified": "2021-02-22T04:24:13.000Z",
    "resourceType": "User"
  }
}
```

**SDK Code**

```python SCIM User Created
import requests

url = "https://api.getpostman.com/scim/v2/Users"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript SCIM User Created
const url = 'https://api.getpostman.com/scim/v2/Users';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go SCIM User Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/scim/v2/Users"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby SCIM User Created
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/scim/v2/Users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java SCIM User Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/scim/v2/Users")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php SCIM User Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/scim/v2/Users', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp SCIM User Created
using RestSharp;

var client = new RestClient("https://api.getpostman.com/scim/v2/Users");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift SCIM User Created
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/scim/v2/Users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create SCIM User



**Request**

```json
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "userName": "taylor.lee@example.com",
  "active": true,
  "externalId": "12345678",
  "groups": [
    "Test Group"
  ],
  "locale": "en-US",
  "name": {
    "givenName": "Taylor",
    "familyName": "Lee"
  },
  "displayName": "Taylor Lee"
}
```

**Response**

```json
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "405775fe15ed41872a8eea4c8aa2b38cda9749812cc55c99",
  "userName": "taylor.lee@example.com",
  "name": {
    "givenName": "Test",
    "familyName": "User"
  },
  "externalId": "12345678",
  "active": true,
  "meta": {
    "created": "2021-02-22T04:24:13.000Z",
    "lastModified": "2021-02-22T04:24:13.000Z",
    "resourceType": "User"
  }
}
```

**SDK Code**

```python Create SCIM User
import requests

url = "https://api.getpostman.com/scim/v2/Users"

payload = {
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "userName": "taylor.lee@example.com",
    "active": True,
    "externalId": "12345678",
    "groups": ["Test Group"],
    "locale": "en-US",
    "name": {
        "givenName": "Taylor",
        "familyName": "Lee"
    },
    "displayName": "Taylor Lee"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create SCIM User
const url = 'https://api.getpostman.com/scim/v2/Users';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],"userName":"taylor.lee@example.com","active":true,"externalId":"12345678","groups":["Test Group"],"locale":"en-US","name":{"givenName":"Taylor","familyName":"Lee"},"displayName":"Taylor Lee"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create SCIM User
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/scim/v2/Users"

	payload := strings.NewReader("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\"\n  ],\n  \"userName\": \"taylor.lee@example.com\",\n  \"active\": true,\n  \"externalId\": \"12345678\",\n  \"groups\": [\n    \"Test Group\"\n  ],\n  \"locale\": \"en-US\",\n  \"name\": {\n    \"givenName\": \"Taylor\",\n    \"familyName\": \"Lee\"\n  },\n  \"displayName\": \"Taylor Lee\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create SCIM User
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/scim/v2/Users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\"\n  ],\n  \"userName\": \"taylor.lee@example.com\",\n  \"active\": true,\n  \"externalId\": \"12345678\",\n  \"groups\": [\n    \"Test Group\"\n  ],\n  \"locale\": \"en-US\",\n  \"name\": {\n    \"givenName\": \"Taylor\",\n    \"familyName\": \"Lee\"\n  },\n  \"displayName\": \"Taylor Lee\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create SCIM User
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/scim/v2/Users")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\"\n  ],\n  \"userName\": \"taylor.lee@example.com\",\n  \"active\": true,\n  \"externalId\": \"12345678\",\n  \"groups\": [\n    \"Test Group\"\n  ],\n  \"locale\": \"en-US\",\n  \"name\": {\n    \"givenName\": \"Taylor\",\n    \"familyName\": \"Lee\"\n  },\n  \"displayName\": \"Taylor Lee\"\n}")
  .asString();
```

```php Create SCIM User
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/scim/v2/Users', [
  'body' => '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "userName": "taylor.lee@example.com",
  "active": true,
  "externalId": "12345678",
  "groups": [
    "Test Group"
  ],
  "locale": "en-US",
  "name": {
    "givenName": "Taylor",
    "familyName": "Lee"
  },
  "displayName": "Taylor Lee"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Create SCIM User
using RestSharp;

var client = new RestClient("https://api.getpostman.com/scim/v2/Users");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:User\"\n  ],\n  \"userName\": \"taylor.lee@example.com\",\n  \"active\": true,\n  \"externalId\": \"12345678\",\n  \"groups\": [\n    \"Test Group\"\n  ],\n  \"locale\": \"en-US\",\n  \"name\": {\n    \"givenName\": \"Taylor\",\n    \"familyName\": \"Lee\"\n  },\n  \"displayName\": \"Taylor Lee\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create SCIM User
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "userName": "taylor.lee@example.com",
  "active": true,
  "externalId": "12345678",
  "groups": ["Test Group"],
  "locale": "en-US",
  "name": [
    "givenName": "Taylor",
    "familyName": "Lee"
  ],
  "displayName": "Taylor Lee"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/scim/v2/Users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```