Interacting with the API
Anaconda maintains a Jupyter notebook that contains Python functions for interfacing with the API, along with instructions for using the notebook itself:Authenticating to the API
The Anaconda.com public API uses OAuth2 standard authentication (with an organization admin’s Anaconda.com username and password) to generate aUser_Token. A User_Token is required to create a service account.
Once a service account is created, use its credentials (the returned client_id and client_secret) for authentication in order to generate a ServiceAccount_Token to manage users via the other API calls described below.
Creating a service account
Creating a service account allows an admin user to specify credentials for a specific machine or machines (like a build server or other machine for pipeline automation) and manage those machines in a similar capacity to a user. The service account can then allow the other API calls to be made directly to the organization the machine user is a part of. You can create as many service accounts per organization as you need. However, Anaconda recommends limiting the number of service accounts to no more than is absolutely necessary. Restricting the number of service accounts enhances your organizations security posture.Service account names must be created using lower case letters, numbers, hyphens, or underscores, and cannot contain spaces or special characters.
API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
anaconda.com/app/organizations/<ORG_ID>/.Get service account ID
This call returns the ID of a previously created service account, but it will not reveal its secret.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
anaconda.com/app/organizations/<ORG_ID>/.Deleting a service account
This call deletes the service account associated with the suppliedclient_id.
API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <CLIENT_ID> with your client_id value.
anaconda.com/app/organizations/<ORG_ID>/.Replace <CLIENT_ID> with your client_id value.
Automated Onboarding of new users
If you are adding users to your organization that do not already have an Anaconda.com account, you can use this call to initiate the automated onboarding process, which will add them to your organization, assign them a seat as a member, and issue them a token for access to the repository. Admins will receive an email that the users have been added to the organization. Users will receive two emails, one welcoming them to the organization, and one containing their private access token, which allows them to use packages from repo.anaconda.cloud.Adding a user to your organization
This call adds users to the organization. If you do not provide an email address when making this call, the system creates an organization-managed user instead. Organization-managed users are not linked to individual accounts and are intended for programmatic use, allowing tokens to be generated specifically for automated processes or integrations. You can create as many managed users as needed. However, Anaconda recommends limiting the number of managed users to only what is required. Restricting their use enhances the security posture of your organization.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
anaconda.com/app/organizations/<ORG_ID>/.If you do not provide a first and last name for your user, the API call will return
null. The user can edit this information from their profile later, if necessary.Assign seat to user
This call assigns a seat to a given user for the organization the user is a member of.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <USER_ID> with the ID of the user you want to assign a seat.
anaconda.com/app/organizations/<ORG_ID>/.Replace <USER_ID> with the ID of the user you want to assign a seat.
Assign token to user
This call assigns a token to a given user. Tokens are a unique security key that enable users to access the subscription seat they have been assigned.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <USER_ID> with the ID of the user you want to assign a token.
anaconda.com/app/organizations/<ORG_ID>/.Replace <USER_ID> with the ID of the user you want to assign a token.
Syncing user tokens
Renewing your subscription does not extend the lifespan of your token. If you have renewed your subscription and want to retain your current token, run this call to synchronize your token and extend its lifespan to your organization’s new subscription expiration date.Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <USER_ID> with the ID of the user whose token needs to be synchronized.
anaconda.com/app/organizations/<ORG_ID>/.Replace <USER_ID> with the ID of the user whose token needs to be synchronized.
Revoking a user’s token
This call revokes a token from a given user ID. It should be used when a user no longer needs access to their software subscription and can be used as the first part in a user removal process.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <USER_ID> with the ID of the user whose token you want to delete.
anaconda.com/app/organizations/<ORG_ID>/.Replace <USER_ID> with the ID of the user whose token you want to delete.
Remove seat from user
This call removes a subscription seat from a given user and can be used as the second part in a user removal process.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <USER_ID> with the ID of the user whose seat you want to delete.
anaconda.com/app/organizations/<ORG_ID>/.Replace <USER_ID> with the ID of the user whose seat you want to delete.
Remove user from organization
This call removes a given user from a given organization and can be used as the final part in a user removal process.API call
Replace <ORG_ID> with your organization ID, found in your Anaconda.com organization’s URL:
Replace <USER_ID> with the ID of the user you want to delete.
anaconda.com/app/organizations/<ORG_ID>/.Replace <USER_ID> with the ID of the user you want to delete.