|
| 1 | +# Organizations |
| 2 | + |
| 3 | +## List your organizations |
| 4 | + |
| 5 | +List organizations for the authenticated user. |
| 6 | + |
| 7 | +``` |
| 8 | +GET /user/orgs |
| 9 | +``` |
| 10 | + |
| 11 | +### Response |
| 12 | + |
| 13 | +``` |
| 14 | +Status: 200 OK |
| 15 | +``` |
| 16 | +```json |
| 17 | +[ |
| 18 | + { |
| 19 | + "id": 6, |
| 20 | + "username": "gogs", |
| 21 | + "full_name": "Gogs", |
| 22 | + "avatar_url": "/avatars/6", |
| 23 | + "description": "Gogs is a painless self-hosted Git Service.", |
| 24 | + "website": "https://gogs.io", |
| 25 | + "location": "USA" |
| 26 | + } |
| 27 | +] |
| 28 | +``` |
| 29 | + |
| 30 | +## List user organizations |
| 31 | + |
| 32 | +List public organization memberships for the specified user. |
| 33 | + |
| 34 | +``` |
| 35 | +GET /users/:username/orgs |
| 36 | +``` |
| 37 | + |
| 38 | +### Response |
| 39 | + |
| 40 | +``` |
| 41 | +Status: 200 OK |
| 42 | +``` |
| 43 | +```json |
| 44 | +[ |
| 45 | + { |
| 46 | + "id": 6, |
| 47 | + "username": "gogs", |
| 48 | + "full_name": "Gogs", |
| 49 | + "avatar_url": "/avatars/6", |
| 50 | + "description": "Gogs is a painless self-hosted Git Service.", |
| 51 | + "website": "https://gogs.io", |
| 52 | + "location": "USA" |
| 53 | + } |
| 54 | +] |
| 55 | +``` |
| 56 | + |
| 57 | +## Get an organization |
| 58 | + |
| 59 | +``` |
| 60 | +GET /orgs/:orgname |
| 61 | +``` |
| 62 | + |
| 63 | +### Response |
| 64 | + |
| 65 | +``` |
| 66 | +Status: 200 OK |
| 67 | +``` |
| 68 | +```json |
| 69 | +{ |
| 70 | + "id": 6, |
| 71 | + "username": "gogs", |
| 72 | + "full_name": "Gogs", |
| 73 | + "avatar_url": "/avatars/6", |
| 74 | + "description": "Gogs is a painless self-hosted Git Service.", |
| 75 | + "website": "https://gogs.io", |
| 76 | + "location": "USA" |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +## Edit an organization |
| 81 | + |
| 82 | +``` |
| 83 | +PATCH /orgs/:org |
| 84 | +``` |
| 85 | + |
| 86 | +### Parameters |
| 87 | + |
| 88 | +|Name|Type|Description| |
| 89 | +|----|----|-----------| |
| 90 | +|full_name|string|Full name of organization| |
| 91 | +|description|string|Description to the organization| |
| 92 | +|website|string|Official website| |
| 93 | +|location|string|Organization location| |
| 94 | + |
| 95 | +### Example |
| 96 | + |
| 97 | +```json |
| 98 | +{ |
| 99 | + "full_name": "Gogs2", |
| 100 | + "description": "Gogs is a painless self-hosted Git Service.", |
| 101 | + "website": "https://gogs.io", |
| 102 | + "location": "USA" |
| 103 | +} |
| 104 | +``` |
| 105 | + |
| 106 | +### Response |
| 107 | + |
| 108 | +``` |
| 109 | +Status: 200 OK |
| 110 | +``` |
| 111 | +```json |
| 112 | +{ |
| 113 | + "id": 6, |
| 114 | + "username": "gogs", |
| 115 | + "full_name": "Gogs2", |
| 116 | + "avatar_url": "/avatars/6", |
| 117 | + "description": "Gogs is a painless self-hosted Git Service.", |
| 118 | + "website": "https://gogs.io", |
| 119 | + "location": "USA" |
| 120 | +} |
| 121 | +``` |
0 commit comments