Create Service Account

posthttps://app.fossa.com/api/users/service-accounts

Create a new service account with specified roles and optional API tokens

Request body (required) · application/json

usernamestringrequired

The username for the service account

emailstring <email>

Optional email address for the service account

fullNamestring

Optional full name/description for the service account

orgRoleIdinteger

ID of the organization role to assign to the service account. At least one of orgRoleId or team must be provided.

teamobject

Team assignment for the service account. At least one of orgRoleId or team must be provided.

idintegerrequired

ID of the team to assign the service account to

roleIdintegerrequired

ID of the team role to assign

hasPushOnlyApiTokenboolean

Whether to create a push-only API token for the service account

hasFullApiTokenboolean

Whether to create a full access API token for the service account

Responses

201Service account created successfully
idintegerrequired

The user id of the service account

usernamestringrequired

The username of the service account

emailstring | null

The email address of the service account (if provided)

full_namestring | null

The full name/description of the service account (if provided)

fullApiTokenstring

The full access API token (only present if hasFullApiToken was true)

pushOnlyApiTokenstring

The push-only API token (only present if hasPushOnlyApiToken was true)

400Bad Request. Returned when the request body fails validation, when neither `orgRoleId` nor `team` is supplied, or when a user with the given username or email already exists in the organization.
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

403Forbidden
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

404Team not found
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

500Server Error
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

Try this endpoint

Build a request and run it against app.fossa.com.

Bearer

Stored in this browser for 24 hours. Try It uses a docs proxy for CORS and does not store tokens server-side.

POST https://app.fossa.com/api/users/service-accounts
curl --request POST \  --url 'https://app.fossa.com/api/users/service-accounts' \  --header 'accept: application/json' \  --header 'authorization: Bearer YOUR_API_TOKEN' \  --header 'content-type: application/json' \  --data '{  "username": "production-api-service",  "email": "prod-api@company.com",  "fullName": "Production API Service Account",  "orgRoleId": 3,  "hasPushOnlyApiToken": false,  "hasFullApiToken": false}'

Real request. Mutating methods can change data.

Click Try It to run a request and see the response here.
Enter a Bearer token before running this request.
application/json