See api-docs Menu

Create Account

Creates an account under a reseller account. This API can be used by reseller accounts only.

For a description of each element in the Account resource, see Account Resource.

Resource URL

https://api.onelogin.com/api/v1/accounts.xml

Parameters

Content-Type

required

string

Set to application/xml.

email

required

string

Email address of the account owner. This must be a company email address. If no firstname and lastname are provided, the account owner name is set to this value.

name

required

string

Company, customer, or organization name.

address1

string

*

address2

string

*

city

string

*

country

string

*

firstname

string

First name of the account owner. If you include firstname, you must include lastname. If no firstname and lastname values are provided, the account owner name is set to the email value.

homepage

string

*

lastname

string

Last name of the account owner. If no firstname and lastname values are provided, the account owner name is set to the email value.

phone

string

Phone number of the account owner.

state

string

*

zip

string

*

Sample Response

This request generates no response.

Here are a few errors that will return a 406 Not Acceptable status code:

--------------------------------------------------------

<errors>
    <error>Please use a company email address.</error>
</errors>

--------------------------------------------------------

<errors>
    <error>Email has already been taken</error>
</errors>

--------------------------------------------------------

<errors>
    <error>Company name can't be blank</error>
</errors>

--------------------------------------------------------

<errors>
    <error>Subdomain can't be blank</error>
</errors>

--------------------------------------------------------

<errors>
    <error>Email can't be blank</error>
</errors>

Sample cURL Request

Try it out with a test account first: Start off with using this cURL request with a test OneLogin account and API key. Once you’ve familiarized yourself with the API’s behavior, switch over to using your production OneLogin account and API key.

Be sure to replace placeholder values surrounded by { } with actual values.

curl -u {api_key}:x -X POST -H "Content-Type: application/xml" \
-d '<account>
<email>{email}</email>
  <firstname>{firstname}</firstname>
  <lastname>{lastname}</lastname>
  <username>{username}</username>
  <openid-name>{openid_name}</openid-name>
  <phone>{phone}</phone>
  <password>{password}</password>
  <password_confirmation>{password_confirmation}</password_confirmation>
  <department>{department}</department>
  <company>{company}</company>
  <title>{title}</title>
  <custom_attribute_{custom_attribute_name}>{custom_attribute_value}
  </custom_attribute_{custom_atrribute_name}>
</user>' \
https://api.onelogin.com/api/v1/accounts.xml

Postman Collection

Try it out with a test account first: Start off with using this Postman Collection with a test OneLogin account and API key. Once you’ve familiarized yourself with the API’s behavior, switch over to using your production OneLogin account and API key.

Replace sample variables indicated by { } in the sample request body with your actual values. Also, be sure to set Postman-specific environment variables indicated by {{ }}.

Download for the Accounts API


Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

Have a product idea or request? Share it with us in our Ideas Portal.