Improve this doc
Detailed information for resources

balenaCloud API Resources

Note: We recently renamed applications to fleets and are in the process of updating our API resources. Application resources continue to function correctly and can be used to work with fleets. Find out more about the changes here.

Available fields

id
actor
username
created_at

Examples

Get users associated with account

curl -X GET \
"https://api.balena-cloud.com/v6/user" \
-H  "Content-Type: application/json"  \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Get users associated with fleet

curl -X GET \
"https://api.balena-cloud.com/v6/user__is_member_of__application?\$expand=user(\$select=id,username,actor),application_membership_role(\$select=id,name,actor)&\$filter=is_member_of__application%20eq%20<ID>" \
-H  "Content-Type: application/json"  \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Create fleet membership

curl -X POST \
"https://api.balena-cloud.com/v6/user__is_member_of__application" \
-H  "Content-Type: application/json"  \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "is_member_of_application": <ID>,
    "username": "<USERNAME>",
    "application_membership_role": <ROLE ID>
}'

Delete fleet membership

curl -X DELETE \
"https://api.balena-cloud.com/v6/user__is_member_of__application?\$filter=is_member_of__application%20eq%20<ID>%20and%20user%20eq%20<USER ID>" \
-H  "Content-Type: application/json"  \
-H "Authorization: Bearer <AUTH_TOKEN>"