{"meta":{"title":"REST-API-Endpunkte für soziale Konten","intro":"Verwende die REST-API, um die Social Media-Konten authentifizierter Benutzer*innen zu verwalten.","product":"REST-API","breadcrumbs":[{"href":"/de/rest","title":"REST-API"},{"href":"/de/rest/users","title":"Benutzer"},{"href":"/de/rest/users/social-accounts","title":"Konten für soziale Netzwerke"}],"documentType":"article"},"body":"# REST-API-Endpunkte für soziale Konten\n\nVerwende die REST-API, um die Social Media-Konten authentifizierter Benutzer\\*innen zu verwalten.\n\n## Informationen zur Verwaltung von Social Media-Konten\n\nWenn eine Anforderungs-URL keinen `{username}`-Parameter enthält, gilt die Antwort für den*die angemeldete*n Benutzer\\*in (und Sie müssen [Authentifizierungsinformationen](/de/rest/authentication/authenticating-to-the-rest-api) mit Ihrer Anforderung übergeben). Zusätzliche private Informationen, z. B. ob ein Benutzer die zweistufige Authentifizierung aktiviert hat, werden bei der Authentifizierung über OAuth mit dem `user` Zugriffsbereich eingeschlossen.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List social accounts for the authenticated user\n\n```\nGET /user/social_accounts\n```\n\nLists all of your social accounts.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/user/social_accounts\n```\n\n**Response schema (Status: 200):**\n\nArray of `Social account`:\n\n* `provider`: required, string\n* `url`: required, string\n\n## Add social accounts for the authenticated user\n\n```\nPOST /user/social_accounts\n```\n\nAdd one or more social accounts to the authenticated user's profile.\nOAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Body parameters\n\n* **`account_urls`** (array of strings) (required)\n  Full URLs for the social media profiles to add.\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Adding multiple social accounts\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/user/social_accounts \\\n  -d '{\n  \"account_urls\": [\n    \"https://facebook.com/GitHub\",\n    \"https://www.youtube.com/@GitHub\"\n  ]\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [List social accounts for the authenticated user](#list-social-accounts-for-the-authenticated-user).\n\n## Delete social accounts for the authenticated user\n\n```\nDELETE /user/social_accounts\n```\n\nDeletes one or more social accounts from the authenticated user's profile.\nOAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Body parameters\n\n* **`account_urls`** (array of strings) (required)\n  Full URLs for the social media profiles to delete.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Deleting multiple social accounts\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/user/social_accounts \\\n  -d '{\n  \"account_urls\": [\n    \"https://facebook.com/GitHub\",\n    \"https://www.youtube.com/@GitHub\"\n  ]\n}'\n```\n\n**Response schema (Status: 204):**\n\n## List social accounts for a user\n\n```\nGET /users/{username}/social_accounts\n```\n\nLists social media accounts for a user. This endpoint is accessible by anyone.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/users/USERNAME/social_accounts\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List social accounts for the authenticated user](#list-social-accounts-for-the-authenticated-user)."}