// @flow import * as React from 'react'; import Grid from 'styled-components-grid'; import styled from 'styled-components'; import PageTitle from '../components/PageTitle'; import Header from '../components/Header'; import Content from '../components/Content'; export default function Pricing() { return (

Developers

Outline is built on an open, best-in-class, API

As developers, it’s our mission to make the API as great as possible. While Outline is still in public beta, we might make small adjustments, including breaking changes to the API.

Making requests

Outline’s API follows simple RPC style conventions where each API endpoint is a method on{' '} https://www.getoutline.com/api/<METHOD>. Both{' '} GET and POST methods are supported but it’s recommeded that you make all call using POST. Only HTTPS is supported in production.

For GET requests query string parameters are expected (e.g. /api/document.info?id=...&token=...). When making{' '} POST requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, one must pass{' '} Content-Type: application/json header:

Example POST request:

              
                {`curl https://www.getoutline.com/api/documents.info
  -X POST
  -H 'authorization: Bearer API_KEY'
  -H 'content-type: application/json'
  -H 'accept: application/json'
  -d '{"id": "outline-api-NTpezNwhUP"}'
`}
              
            

Example GET request:

              
                {`curl https://www.getoutline.com/api/documents.info?id=outline-api-NTpezNwhUP&token=API_KEY
`}
              
            

Authentication

To access private API endpoints, you must provide a valid API key. You can create new API keys in your{' '} account settings. Be careful when handling your keys as they give access to all of your documents.

To authenticate with Outline API, you can supply the API key as a header (Authorization: Bearer YOUR_API_KEY) or as part of the payload using token parameter. If you’re making GET requests, header based authentication is recommended so that your keys don’t leak into logs.

Some API endpoints allow unauhenticated requests for public resources and they can be called without an API key.

Errors

All successful API requests will be returned with 200{' '} status code and ok: true in the response payload. If there’s an error while making the request, appropriate status code is returned with the error message:

              
                {`{
  "ok": false,
  "error: "Not Found"
}
`}
              
            
); } const Pre = styled.pre` padding: 0.5em 1em; background: #f9fbfc; border-radius: 4px; border: 1px solid #e8ebed; overflow: scroll; `; const Code = styled.code` font-size: 15px; `; const MenuItem = styled.a` display: flex; align-items: center; font-size: 16px; color: ${props => props.theme.text}; `; const List = styled.ul` list-style: none; margin: 0; padding: 0; `;