@@ -129,6 +129,81 @@ can specify multiple scopes by separating them by a comma.
129129 client_id=...&
130130 scope=user,public_repo
131131
132+ ## OAuth Authorizations API
133+
134+ There is an API for users to manage their own tokens. You can only
135+ access your own tokens, and only through Basic Authentication.
136+
137+ ## List your authorizations
138+
139+ GET /authorizations
140+
141+ ### Response
142+
143+ <%= headers 200, : pagination => true %>
144+ <%= json(: oauth_access ) { |h| [ h] } %>
145+
146+ ## Get a single authorization
147+
148+ GET /authorizations/:id
149+
150+ ### Response
151+
152+ <%= headers 200 %>
153+ <%= json : oauth_access %>
154+
155+ ## Create a new authorization
156+
157+ Note: Authorizations created from the API will show up in the GitHub API
158+ app.
159+
160+ POST /authorizations
161+
162+ ### Input
163+
164+ scopes
165+ : _ Optional_ ** array** - A list of scopes that this authorization is in.
166+
167+ <%= json : scopes => [ "public_repo"] %>
168+
169+ ### Response
170+
171+ <%= headers 201, : Location => "https://api.github.com/authorizations/1 "
172+ %>
173+ <%= json : oauth_access %>
174+
175+ ## Update an existing authorization
176+
177+ PATCH /authorizations/1
178+
179+ ### Input
180+
181+ scopes
182+ : _ Optional_ ** array** - Replaces the authorization' scopes with these.
183+
184+ add_scopes
185+ : _ Optional_ ** array** - A list of scopes to add to this authorization.
186+
187+ remove_scopes
188+ : _ Optional_ ** array** - A list of scopes to remove from this
189+ authorizatin.
190+
191+ You can only send one of these scope keys at a time.
192+
193+ <%= json : add_scopes => [ 'repo'] %>
194+
195+ ### Response
196+
197+ <%= headers 200 %>
198+ <%= json : oauth_access %>
199+
200+ ## Delete an authorization
201+
202+ DELETE /authorizations/1
203+
204+ ### Response
205+
206+ <%= headers 204 %>
132207
133208## More Information
134209
0 commit comments