Accounts - List

Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId.

GET https://app.vssps.visualstudio.com/_apis/accounts?api-version=7.1-preview.1
GET https://app.vssps.visualstudio.com/_apis/accounts?ownerId={ownerId}&memberId={memberId}&properties={properties}&api-version=7.1-preview.1

URI Parameters

Name In Required Type Description
api-version
query True

string

Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.

memberId
query

string

uuid

ID for a member of the accounts.

ownerId
query

string

uuid

ID for the owner of the accounts.

properties
query

string

Responses

Name Type Description
200 OK

Account[]

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.profile Grants the ability to read your profile, accounts, collections, projects, teams, and other top-level organizational artifacts.

Examples

By member
By owner

By member

Sample Request

GET https://app.vssps.visualstudio.com/_apis/accounts?memberId=d6245f20-2af8-44f4-9451-8107cb2767db&api-version=7.1-preview.1

Sample Response

{
  "count": 2,
  "value": [
    {
      "accountId": "6affcbef-fe5d-44c6-8a29-439b79aaa118",
      "accountUri": "https://vssps.dev.azure.com/Fabrikam-Fiber-Inc/",
      "accountName": "Fabrikam-Fiber-Inc",
      "properties": {}
    },
    {
      "accountId": "bf83696f-383b-4980-95b5-1f1127640a8a",
      "accountUri": "https://vssps.dev.azure.com/NormalPaulk/",
      "accountName": "NormalPaulk",
      "properties": {}
    }
  ]
}

By owner

Sample Request

GET https://app.vssps.visualstudio.com/_apis/accounts?ownerId=d6245f20-2af8-44f4-9451-8107cb2767db&api-version=7.1-preview.1

Sample Response

{
  "count": 1,
  "value": [
    {
      "accountId": "bf83696f-383b-4980-95b5-1f1127640a8a",
      "accountUri": "https://NormalPaulk.vssps.visualstudio.com:443/",
      "accountName": "NormalPaulk",
      "properties": {}
    }
  ]
}

Definitions

Name Description
Account
AccountStatus

Current account status

AccountType

Type of account: Personal, Organization

PropertiesCollection

The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a TypeCode != TypeCode.Object) except for DBNull are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string.

Account

Name Type Description
accountId

string

Identifier for an Account

accountName

string

Name for an account

accountOwner

string

Owner of account

accountStatus

AccountStatus

Current account status

accountType

AccountType

Type of account: Personal, Organization

accountUri

string

Uri for an account

createdBy

string

Who created the account

createdDate

string

Date account was created

hasMoved

boolean

lastUpdatedBy

string

Identity of last person to update the account

lastUpdatedDate

string

Date account was last updated

namespaceId

string

Namespace for an account

newCollectionId

string

organizationName

string

Organization that created the account

properties

PropertiesCollection

Extended properties

statusReason

string

Reason for current status

AccountStatus

Current account status

Name Type Description
deleted

string

This account is part of deletion batch and scheduled for deletion.

disabled

string

This hosting account is disabled.

enabled

string

This hosting account is active and assigned to a customer.

moved

string

This account is not mastered locally and has physically moved.

none

string

AccountType

Type of account: Personal, Organization

Name Type Description
organization

string

personal

string

PropertiesCollection

The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a TypeCode != TypeCode.Object) except for DBNull are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string.

Name Type Description
count

integer

The count of properties in the collection.

item

object

keys

string[]

The set of keys in the collection.

values

string[]

The set of values in the collection.