### C# example - GET highlights Source: https://docs.linkwarden.app/api/get-highlights-for-a-link C# code example using HttpClient to send a GET request to the highlights endpoint. Includes Authorization header with Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/links/:id/highlights"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Current NEXTAUTH_URL example Source: https://docs.linkwarden.app/self-hosting/upgrading/to-linkwarden-v2 Example of the NEXTAUTH_URL environment variable before the upgrade, as used in the default installation. ```plaintext NEXTAUTH_URL=http://localhost:3000 ``` -------------------------------- ### C# (HttpClient) example for GET /api/v1/config Source: https://docs.linkwarden.app/api/retrieves-public-runtime-configuration Uses HttpClient to send a GET request to the endpoint with an Accept header for application/json. The response is printed to the console. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/config"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient example for migration endpoint Source: https://docs.linkwarden.app/api/retrieve-migration-data C# example using HttpClient to send a GET request to the migration endpoint. Requires a valid bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/migration"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.linkwarden.app/api/get-tokens Example of making a GET request to the tokens endpoint using C# HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/tokens"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.linkwarden.app/api/get-a-collection-by-its-id C# example using HttpClient to fetch a collection by ID. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/public/collections/:id"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient example for GET /api/v1/public/links/:id Source: https://docs.linkwarden.app/api/get-a-link-by-id A C# example using HttpClient to send a GET request to the endpoint. It adds an Accept header for application/json and ensures the response is successful before printing the content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/public/links/:id"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient example Source: https://docs.linkwarden.app/api/retrieve-links-from-a-specific-collection Example C# code using HttpClient to send a GET request to the endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/public/collections/links"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# example using HttpClient Source: https://docs.linkwarden.app/api/get-collection-by-id C# code example using HttpClient to send a GET request to the endpoint with an Authorization header. It requires a valid bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/collections/:id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Request body example Source: https://docs.linkwarden.app/api/create-user Example of the JSON request body for creating a user. Includes name, password, email, username, and invite fields. ```json { "name": "string", "password": "string", "email": "user@example.com", "username": "string", "invite": true } ``` -------------------------------- ### Gemini example Source: https://docs.linkwarden.app/self-hosting/ai-worker Example for using Google's Gemini via an OpenAI-compatible endpoint. Requires CUSTOM_OPENAI_BASE_URL and OPENAI_API_KEY. ```env CUSTOM_OPENAI_BASE_URL=https://generativelanguage.googleapis.com/v1beta OPENAI_MODEL=gemini-2.5-flash-preview-04-17 OPENAI_API_KEY=YOUR_GOOGLE_AI_STUDIO_API_KEY ``` -------------------------------- ### Start the app with Yarn Source: https://docs.linkwarden.app/self-hosting/setup Starts the Linkwarden application using the concurrently:start script. ```bash yarn concurrently:start ``` -------------------------------- ### Run migration script for manual installation Source: https://docs.linkwarden.app/self-hosting/upgrading/to-linkwarden-v2 Command to run the migration script for manual installations. ```bash node scripts/migration/migrateToV2.js ``` -------------------------------- ### C# HttpClient request example Source: https://docs.linkwarden.app/api/retrieves-the-avatar-of-a-user-by-their-id C# example using HttpClient to send a GET request to the avatar endpoint. Requires a valid bearer token and accepts image/jpeg. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/avatar/:id"); request.Headers.Add("Accept", "image/jpeg"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### 200 Response Example Source: https://docs.linkwarden.app/api/get-tokens Example of a successful response with a list of tokens. ```json { "response": [ { "id": 0, "name": "string", "isSession": true, "expires": "2024-07-29T15:51:28.071Z", "createdAt": "2024-07-29T15:51:28.071Z" } ] } ``` -------------------------------- ### Request Body Example Source: https://docs.linkwarden.app/api/update-user-preference Example request body for updating preferences. Shows the required fields: theme, readableFontFamily, readableFontSize, readableLineHeight, and readableLineWidth. ```json { "theme": "dark", "readableFontFamily": "string", "readableFontSize": "string", "readableLineHeight": "string", "readableLineWidth": "string" } ``` -------------------------------- ### C# HttpClient example Source: https://docs.linkwarden.app/api/get-login-configuration C# code using HttpClient to send a GET request to the login configuration endpoint. Adds an Accept header for application/json and ensures the response is successful. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/logins"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient GET Request Source: https://docs.linkwarden.app/api/get-user C# example using HttpClient to send a GET request to the endpoint with Accept and Authorization headers. Requires a valid bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/users/:id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Install dependencies with Yarn Source: https://docs.linkwarden.app/self-hosting/setup Installs the necessary dependencies for the Linkwarden workspaces using Yarn. ```bash yarn workspaces focus linkwarden @linkwarden/web @linkwarden/worker ``` -------------------------------- ### C# HttpClient GET request to search links Source: https://docs.linkwarden.app/api/search-links Use this C# example to send a GET request to the Linkwarden search API endpoint. It sets the Accept header to application/json and ensures the response is successful before printing the content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/search"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start Linkwarden with Docker Compose Source: https://docs.linkwarden.app/self-hosting/setup Starts the Linkwarden application using Docker Compose. After a few minutes, access Linkwarden at http://localhost:3000. ```bash docker compose up ``` -------------------------------- ### C# HTTP client example Source: https://docs.linkwarden.app/api/create-user Example of creating a user using C# HttpClient. Sends a POST request to the endpoint with a JSON body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.linkwarden.app/api/v1/users"); request.Headers.Add("Accept", "application/json"); var content = new StringContent("{\n \"name\": \"string\",\n \"password\": \"string\",\n \"email\": \"user@example.com\",\n \"username\": \"string\",\n \"invite\": true\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example response schema for GET /api/v1/config Source: https://docs.linkwarden.app/api/retrieves-public-runtime-configuration Shows the JSON response structure returned by the endpoint. The response object contains nullable fields for configuration values. ```json { "response": { "DISABLE_REGISTRATION": true, "ADMIN": 0, "RSS_POLLING_INTERVAL_MINUTES": 0, "EMAIL_PROVIDER": true, "MAX_FILE_BUFFER": 0, "USER_CONTENT_DOMAIN": "https://usercontent.example.com", "AI_ENABLED": true, "INSTANCE_VERSION": "string" } } ``` -------------------------------- ### C# HttpClient Example Source: https://docs.linkwarden.app/api/update-user-preference C# example using HttpClient to send a PUT request to the preference endpoint. Includes Authorization header with Bearer token and a JSON body with theme set to dark. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://docs.linkwarden.app/api/v1/users/:id/preference"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"theme\": \"dark\",\n \"readableFontFamily\": \"string\",\n \"readableFontSize\": \"string\",\n \"readableLineHeight\": \"string\",\n \"readableLineWidth\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Successful Response Example Source: https://docs.linkwarden.app/api/update-collection Example JSON response returned when a collection is successfully updated. ```json { "response": { "id": 3, "name": "Health and Wellness", "description": "Latest articles on health and wellness.", "icon": "string", "iconWeight": "fill", "color": "#0ea5e9", "parentId": null, "isPublic": false, "ownerId": 1, "createdById": 2, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z", "_count": { "links": 3 }, "members": [ { "userId": 3, "collectionId": 4, "canCreate": true, "canUpdate": true, "canDelete": true, "createdAt": "2024-12-02T05:50:22.680Z", "updatedAt": "2024-12-02T05:50:22.680Z", "user": { "username": "user1", "name": "John Doe", "image": null } } ] } } ``` -------------------------------- ### Login configuration response schema example Source: https://docs.linkwarden.app/api/get-login-configuration Example JSON response body for the login configuration endpoint. Shows the structure with nullable string fields and an array of button authentication methods. ```json { "credentialsEnabled": "string", "emailEnabled": "string", "registrationDisabled": "string", "buttonAuths": [ { "method": "string", "name": "string" } ] } ``` -------------------------------- ### C# HttpClient example for list RSS subscriptions Source: https://docs.linkwarden.app/api/list-rss-subscriptions C# example using HttpClient to call the list RSS subscriptions endpoint. Requires a valid bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/rss"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Install NGINX and Certbot Source: https://docs.linkwarden.app/self-hosting/reverse-proxy Updates the package list and installs NGINX, Certbot, and the Certbot NGINX plugin on Ubuntu. ```bash sudo apt update sudo apt install -y nginx certbot python3-certbot-nginx ``` -------------------------------- ### OpenAI official API example Source: https://docs.linkwarden.app/self-hosting/ai-worker Example for using OpenAI's official API. CUSTOM_OPENAI_BASE_URL is not needed as it defaults to OpenAI's API URL. ```env OPENAI_MODEL=gpt-4o OPENAI_API_KEY=YOUR_OPENAI_API_KEY ``` -------------------------------- ### POST /api/v1/links Source: https://docs.linkwarden.app/api/create-link Endpoint to create a new link. The request body must be application/json and includes fields such as name, url, type, description, tags, and collection. The url field example is https://example.com, type example is url, description example is 'Some additional thoughts...', tags example includes id 1 and name 'test', and collection example includes id 1 and name 'Unorganized'. ```http POST ## /api/v1/links ``` -------------------------------- ### C# HttpClient example for verify-email Source: https://docs.linkwarden.app/api/verifies-the-users-email-after-they-click-a-verification-link C# example using HttpClient to call the verify-email endpoint. It sends a POST request with an Accept header and prints the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.linkwarden.app/api/v1/auth/verify-email"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient example Source: https://docs.linkwarden.app/api/create-an-rss-subscription Example using HttpClient in C# to call the endpoint with a bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.linkwarden.app/api/v1/rss"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"name\": \"string\",\n \"url\": \"string\",\n \"collectionId\": 0,\n \"collectionName\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Request Source: https://docs.linkwarden.app/api/creates-a-short-lived-preserved-format-url C# example using HttpClient to send a GET request to the preserved token endpoint. It adds an Accept header for JSON and prints the response content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://docs.linkwarden.app/api/v1/preserved/token"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example response for GET /api/v1/public/links/:id Source: https://docs.linkwarden.app/api/get-a-link-by-id A sample JSON response showing the structure of a link object, including fields like id, name, type, description, collection, tags, and pinnedBy. ```json { "response": { "id": 4, "name": "Example link", "type": "url", "description": "Some additional thoughts...", "createdById": 1, "collectionId": 3, "icon": "Airplane", "iconWeight": "fill", "color": "#0ea5e9", "url": "https://example.com", "textContent": "Example Domain This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission. More information...", "preview": "archives/preview/3/4.jpeg", "image": "archives/preview/3/4.jpeg", "pdf": "archives/preview/3/4.pdf", "readable": "archives/3/4_readability.json", "monolith": "unavailable", "lastPreserved": "2024-12-02T00:40:22.295Z", "importDate": "2024-12-02T00:40:22.295Z", "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z", "tags": [ { "id": 2, "name": "Technology", "ownerId": 1, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z" } ], "collection": { "id": 3, "name": "Health and Wellness", "description": "Latest articles on health and wellness.", "icon": "string", "iconWeight": "fill", "color": "#0ea5e9", "parentId": null, "isPublic": false, "ownerId": 1, "createdById": 2, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z" }, "pinnedBy": [ 1, 2, 3 ] } } ``` -------------------------------- ### Success response example Source: https://docs.linkwarden.app/api/delete-user Example response for a successful deletion, returning a confirmation message. ```json { "response": "User account and all related data deleted successfully." } ``` -------------------------------- ### Request body example Source: https://docs.linkwarden.app/api/import-data-for-migration Example request body for the migration endpoint. The format field is an integer (0-4) and data is a string. ```json { "format": 0, "data": "string" } ``` -------------------------------- ### C# HttpClient example Source: https://docs.linkwarden.app/api/resets-the-password-for-a-user-using-a-valid-token C# example using HttpClient to send a POST request to the reset-password endpoint. The request body includes the token and new password. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.linkwarden.app/api/v1/auth/reset-password"); request.Headers.Add("Accept", "application/json"); var content = new StringContent("{\n \"token\": \"string\",\n \"password\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Successful response schema example Source: https://docs.linkwarden.app/api/create-an-rss-subscription Example of the 200 response body when the RSS subscription is created successfully. ```json { "response": { "id": 0, "name": "string", "url": "string", "ownerId": 0, "collectionId": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } } ``` -------------------------------- ### 200 Response Example for /api/v1/links Source: https://docs.linkwarden.app/api/retrieve-a-list-of-links Example JSON response for a successful request, showing a list of links with details like id, name, url, tags, and collection. ```json { "response": [ { "id": 4, "name": "Example link", "type": "url", "description": "Some additional thoughts...", "createdById": 1, "collectionId": 3, "icon": "Airplane", "iconWeight": "fill", "color": "#0ea5e9", "url": "https://example.com", "textContent": "Example Domain This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission. More information...", "preview": "archives/preview/3/4.jpeg", "image": "archives/preview/3/4.jpeg", "pdf": "archives/preview/3/4.pdf", "readable": "archives/3/4_readability.json", "monolith": "unavailable", "lastPreserved": "2024-12-02T00:40:22.295Z", "importDate": "2024-12-02T00:40:22.295Z", "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z", "tags": [ { "id": 2, "name": "Technology", "ownerId": 1, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z" } ], "collection": { "id": 3, "name": "Health and Wellness", "description": "Latest articles on health and wellness.", "icon": "string", "iconWeight": "fill", "color": "#0ea5e9", "parentId": null, "isPublic": false, "ownerId": 1, "createdById": 2, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z" }, "pinnedBy": [ 1, 2, 3 ] } ] } ``` -------------------------------- ### C# HttpClient example Source: https://docs.linkwarden.app/api/create-collection C# example using HttpClient to send a POST request to create a collection. It sets the Authorization header with a bearer token and sends an empty JSON body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://docs.linkwarden.app/api/v1/collections/:id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent(string.Empty); content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### 200 Response Example Source: https://docs.linkwarden.app/api/get-user-by-id Example of a successful 200 response containing the user object with fields such as id, name, username, email, image, and archive settings. ```json { "response": { "id": 1, "name": "John Doe", "username": "user1", "email": "string", "image": "string", "archiveAsScreenshot": false, "archiveAsMonolith": false, "archiveAsPDF": true } } ``` -------------------------------- ### C# example using HttpClient Source: https://docs.linkwarden.app/api/delete-tags-bulk C# code example to call the DELETE /api/v1/tags endpoint with a bearer token and a JSON body containing tagIds. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Delete, "https://docs.linkwarden.app/api/v1/tags"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"tagIds\": [\n 0\n ]\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Success response example (200) Source: https://docs.linkwarden.app/api/get-users Example response body for a successful request. Contains an array of user objects with fields id, username, email, emailVerified, subscriptions, and createdAt. ```json { "response": [ { "id": 0, "username": "string", "email": "string", "emailVerified": "string", "subscriptions": "string", "createdAt": "2024-07-29T15:51:28.071Z" } ] } ``` -------------------------------- ### 200 Response Example Source: https://docs.linkwarden.app/api/update-user-preference Example response body for a successful update (HTTP 200). Shows the structure of the updated user preferences, including theme, readable font settings, dashboard sections, and subscription objects. ```json { "response": { "id": 0, "theme": "string", "readableFontFamily": "string", "readableFontSize": "string", "readableLineHeight": "string", "readableLineWidth": "string", "dashboardSections": [ {} ], "subscription": {}, "parentSubscription": {} } } ``` -------------------------------- ### C# HttpClient example Source: https://docs.linkwarden.app/api/revoke-token Example using C# HttpClient to send a DELETE request to the revoke token endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Delete, "https://docs.linkwarden.app/api/v1/tokens/:id"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Response schema example Source: https://docs.linkwarden.app/api/create-user Example of a successful response body. The response object contains user details such as id, name, email, and various settings. ```json { "response": { "id": 0, "name": "string", "username": "string", "email": "string", "emailVerified": "string", "unverifiedNewEmail": "string", "image": "string", "locale": "string", "parentSubscriptionId": "string", "collectionOrder": [ 0 ], "linksRouteTo": "string", "preventDuplicateLinks": true, "archiveAsScreenshot": true, "archiveAsMonolith": true, "archiveAsPDF": true, "archiveAsWaybackMachine": true, "isPrivate": true, "referredBy": "string", "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } } ``` -------------------------------- ### Migration data response example Source: https://docs.linkwarden.app/api/retrieve-migration-data Example response body for a successful migration data retrieval. Contains user profile fields, collection order, archiving preferences, and nested collections with links and tags. ```json { "name": "string", "username": "string", "email": "string", "emailVerified": true, "unverifiedNewEmail": "string", "image": "string", "locale": "string", "parentSubscriptionId": "string", "collectionOrder": [ 0 ], "linksRouteTo": "string", "preventDuplicateLinks": true, "archiveAsScreenshot": true, "archiveAsMonolith": true, "archiveAsPDF": true, "archiveAsWaybackMachine": true, "isPrivate": true, "referredBy": "string", "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "collections": [ { "id": 0, "name": "string", "description": "string", "icon": "string", "iconWeight": "string", "color": "string", "parentId": 0, "isPublic": true, "ownerId": 0, "createdById": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "links": [ { "id": 0, "name": "string", "type": "string", "description": "string", "createdById": 0, "collectionId": 0, "icon": "string", "iconWeight": "string", "color": "string", "url": "string", "textContent": "string", "preview": "string", "image": "string", "pdf": "string", "readable": "string", "monolith": "string", "lastPreserved": "2024-07-29T15:51:28.071Z", "importDate": "2024-07-29T15:51:28.071Z", "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "tags": [ { "id": 0, "name": "string", "ownerId": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } ] } ] } ], "pinnedLinks": [ {} ], "whitelistedUsers": [ {} ] } ``` -------------------------------- ### Response schema example Source: https://docs.linkwarden.app/api/revoke-token Example response body for a successful revocation, showing the token object with fields like id, name, token, revoked, and timestamps. ```json { "response": { "id": 0, "name": "string", "userId": 0, "token": "string", "revoked": true, "isSession": true, "expires": "2024-07-29T15:51:28.071Z", "lastUsedAt": "2024-07-29T15:51:28.071Z", "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } } ``` -------------------------------- ### Example response for search links Source: https://docs.linkwarden.app/api/search-links Example JSON response for a successful search. Shows the structure of the data object with nextCursor and links array, including nested tags and collection objects. ```json { "message": "string", "data": { "nextCursor": 0, "links": [ { "id": 4, "name": "Example link", "type": "url", "description": "Some additional thoughts...", "createdById": 1, "collectionId": 3, "icon": "Airplane", "iconWeight": "fill", "color": "#0ea5e9", "url": "https://example.com", "textContent": "Example Domain This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission. More information...", "preview": "archives/preview/3/4.jpeg", "image": "archives/preview/3/4.jpeg", "pdf": "archives/preview/3/4.pdf", "readable": "archives/3/4_readability.json", "monolith": "unavailable", "lastPreserved": "2024-12-02T00:40:22.295Z", "importDate": "2024-12-02T00:40:22.295Z", "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z", "tags": [ { "id": 2, "name": "Technology", "ownerId": 1, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z" } ], "collection": { "id": 3, "name": "Health and Wellness", "description": "Latest articles on health and wellness.", "icon": "string", "iconWeight": "fill", "color": "#0ea5e9", "parentId": null, "isPublic": false, "ownerId": 1, "createdById": 2, "createdAt": "2024-12-02T00:40:22.295Z", "updatedAt": "2024-12-02T00:40:22.295Z" }, "pinnedBy": [ 1, 2, 3 ] } ] } } ``` -------------------------------- ### Update User - C# HttpClient Example Source: https://docs.linkwarden.app/api/update-user C# example using HttpClient to send a PUT request to update a user. Includes bearer token authorization and JSON request body. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://docs.linkwarden.app/api/v1/users/:id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"username\": \"user1\",\n \"image\": \"path/to/image.jpg\",\n \"password\": \"string\",\n \"newPassword\": \"string\",\n \"oldPassword\": \"string\",\n \"archiveAsScreenshot\": true,\n \"archiveAsPDF\": true,\n \"archiveAsMonolith\": true,\n \"archiveAsWaybackMachine\": true,\n \"locale\": \"string\",\n \"isPrivate\": true,\n \"preventDuplicateLinks\": true,\n \"collectionOrder\": [\n 0\n ],\n \"linksRouteTo\": \"ORIGINAL\",\n \"whitelistedUsers\": [\n \"string\"\n ],\n \"referredBy\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Build the app and setup the database Source: https://docs.linkwarden.app/self-hosting/setup Generates Prisma client, builds the web app, and deploys database migrations. ```bash yarn prisma:generate yarn web:build yarn prisma:deploy ``` -------------------------------- ### Request body example Source: https://docs.linkwarden.app/api/create-an-rss-subscription The JSON body for the POST request. ```json { "name": "string", "url": "string", "collectionId": 0, "collectionName": "string" } ``` -------------------------------- ### Update User - Success Response Example Source: https://docs.linkwarden.app/api/update-user Example response body for a successful update (200). Contains the updated user object with fields like id, name, username, email, and various settings. ```json { "response": { "id": 1, "name": "John Doe", "username": "user1", "email": "string", "emailVerified": "string", "image": "", "locale": "en", "collectionOrder": [], "linksRouteTo": "ORIGINAL", "preventDuplicateLinks": false, "archiveAsScreenshot": true, "archiveAsMonolith": true, "archiveAsPDF": true, "archiveAsWaybackMachine": false, "isPrivate": false, "referredBy": "string", "createdAt": "2024-12-01T22:04:16.492Z", "updatedAt": "2024-12-01T22:14:05.742Z", "whitelistedUsers": [], "subscription": {}, "parentSubscription": { "user": {} } } } ``` -------------------------------- ### Create NGINX Site File Source: https://docs.linkwarden.app/self-hosting/reverse-proxy Opens the NGINX site configuration file for Linkwarden in the nano editor. ```bash sudo nano /etc/nginx/sites-available/linkwarden ``` -------------------------------- ### 200 Response Example Source: https://docs.linkwarden.app/api/get-tag Example response for a successful retrieval (HTTP 200). Contains the tag's id, name, ownerId, timestamps, and a `_count` object with the number of links. ```json { "response": { "id": 0, "name": "string", "ownerId": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "_count": { "links": 0 } } } ``` -------------------------------- ### Create Data Directories Source: https://docs.linkwarden.app/self-hosting/non-root Create the necessary data directories on the host before starting the containers to ensure correct ownership. ```bash mkdir -p data pgdata meili_data ``` -------------------------------- ### Update User - Request Body Example Source: https://docs.linkwarden.app/api/update-user Example JSON request body for updating a user. Includes fields like name, email, username, image, password, and various settings. ```json { "name": "John Doe", "email": "john.doe@example.com", "username": "user1", "image": "path/to/image.jpg", "password": "string", "newPassword": "string", "oldPassword": "string", "archiveAsScreenshot": true, "archiveAsPDF": true, "archiveAsMonolith": true, "archiveAsWaybackMachine": true, "locale": "string", "isPrivate": true, "preventDuplicateLinks": true, "collectionOrder": [ 0 ], "linksRouteTo": "ORIGINAL", "whitelistedUsers": [ "string" ], "referredBy": "string" } ``` -------------------------------- ### 200 Response Example Source: https://docs.linkwarden.app/api/get-current-user Example response body for a successful request (200). Shows the structure of the user object, including id, name, username, email, image, locale, dashboardSections, subscription, parentSubscription, and hasUnIndexedLinks. ```json { "response": { "id": 0, "name": "string", "username": "string", "email": "string", "image": "string", "locale": "string", "dashboardSections": [ {} ], "subscription": {}, "parentSubscription": {}, "hasUnIndexedLinks": true } } ``` -------------------------------- ### Authorization header example Source: https://docs.linkwarden.app/api/create-token Shows the bearer token authentication format for the API. ```http **name:** bearerAuth**type: **http**scheme: **bearer**bearerFormat: **JWT ``` -------------------------------- ### GET /api/v1/links Source: https://docs.linkwarden.app/api/retrieve-a-list-of-links Documentation for the GET /api/v1/links endpoint, which retrieves a list of links. It includes authentication details, query parameters, and a request example. ```APIDOC ## GET /api/v1/links ### Description Retrieves a list of links from the Linkwarden API. This endpoint requires bearer token authentication. ### Method GET ### Endpoint https://docs.linkwarden.app/api/v1/links ### Parameters #### Query Parameters - **sort** (string) - Optional - Sorting criteria for the links. - **cursor** (string) - Optional - Pagination cursor for retrieving the next set of results. - **collectionId** (string) - Optional - Filter links by collection ID. - **tagId** (string) - Optional - Filter links by tag ID. - **pinnedOnly** (boolean) - Optional - Filter to only pinned links. Values: true, false. - **searchQueryString** (string) - Optional - Search query to filter links by a string. ### Request Example ```http GET https://docs.linkwarden.app/api/v1/links Authorization: Bearer Accept: application/json ``` ### Response #### Success Response (200) Returns a list of links in JSON format. #### Response Example ```json { "links": [] } ``` ``` -------------------------------- ### GET /api/v1/rss Source: https://docs.linkwarden.app/api/list-rss-subscriptions This snippet documents the GET /api/v1/rss endpoint, which lists RSS subscriptions. It includes the endpoint, authorization, response schemas, and examples. ```APIDOC ## GET /api/v1/rss ### Description List RSS subscriptions. ### Method GET ### Endpoint /api/v1/rss ### Authorization - **bearerAuth** (http, bearer, JWT) - Required ### Responses #### Success Response (200) - **response** (array of objects) - RSS subscriptions retrieved successfully. - **id** (integer) - ID of the RSS subscription. - **name** (string) - Name of the RSS subscription. - **url** (uri) - URL of the RSS subscription. - **ownerId** (integer) - ID of the owner. - **collectionId** (integer) - ID of the collection. - **createdAt** (date-time) - Creation timestamp. - **updatedAt** (date-time) - Last update timestamp. - **collection** (object) - Collection details. - **name** (string) - Name of the collection. #### Response Example ```json { "response": [ { "id": 0, "name": "string", "url": "string", "ownerId": 0, "collectionId": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "collection": { "name": "string" } } ] } ``` #### Unauthorized (401) - **response** (string) - Unauthorized error message. #### Response Example ```json { "response": "string" } ``` ### Request Example ```http GET https://docs.linkwarden.app/api/v1/rss Accept: application/json Authorization: Bearer ``` ``` -------------------------------- ### Request body example Source: https://docs.linkwarden.app/api/delete-tags-bulk Example JSON body for the DELETE request, containing a tagIds array. ```json { "tagIds": [ 0 ] } ```