Working with OAuth
OAuth allows you to request market data and manage portfolios on behalf of your end-users. For further details on the OAuth functionality, please see the OAuth documentation.
Note
Each endpoint may have different base URLs.
Redirect User for Authorization
GET /oauth/authorize
Redirect your user from your application to this endpoint with the following query parameters.
Use the following base URL https://app.alpaca.markets
Example Request URL: https://app.alpaca.markets/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URL&state=SOMETHING_RANDOM&scope=account:write%20trading
Request
Query Parameters
Attribute | Type | Requirement | Description |
---|---|---|---|
response_type | string | Required | Must be code to request an authorization code. |
client_id | string | Required | The client_id you received when you registered the application. |
redirect_uri | string | Required | The URL where the user will be sent after authorization. It must match one of the whitelisted redirect URIs for your application. |
state | string | Optional | An unguessable random string, used to protect against request forgery attacks. |
scope | string | Optional | A space-delimited list of scopes your application requests access to. Read-only endpoint access is assumed by default. |
Response
Redirect to Alpaca authorization page.
Updated 16 days ago