// @flow
import * as React from 'react';
import styled from 'styled-components';
import Grid from 'styled-components-grid';
import PageTitle from '../components/PageTitle';
import Header from '../components/Header';
import Content from '../components/Content';
export default function Api() {
return (
API Reference
Outline is built on an open, best-in-class, API
This method returns the user and team info for the user identified
by the token.
List all of the events in the team.List all of the users in the team.
This method returns the profile info for the user identified by
the token.
You can upload small files and images as part of your documents.
All files are stored using Amazon S3. Instead of uploading files
to Outline, you need to upload them directly to S3 with
credentials which can be obtained through this endpoint.
Promote a user to be a team admin. This endpoint is only available
for admin users.
Demote existing team admin if there are more than one as one admin
is always required. This endpoint is only available for admin
users.
Admin can suspend users to reduce the number of accounts on their
billing plan or prevent them from accessing documention.
Admin can re-active a suspended user. This will update the billing
plan and re-enable their access to the documention.
List all your document collections.
Returns detailed information on a document collection.
Creates a new document collection.
Returns a zip file of all the collections documents in markdown
format. If documents are nested then they will be nested in
folders inside the zip file.
Returns a zip file of all the collections or creates an async job
to send a zip file via email to the authenticated user. If
documents are nested then they will be nested in folders inside
the zip file.
This method allows you to modify an already created collection.
This method allows you to add a user to a private collection.
This method allows you to remove a user from a private collection.
This method allows you to give all members in a group access to a
collection.
This method allows you to revoke all members in a group access to
a collection. Note that members of the group may still retain
access through other groups or individual memberships.
This method allows you to list a collections individual
memberships. This is both a collections maintainers, and user
permissions for read and write if the collection is private
This method allows you to list a collections group memberships.
This is the list of groups that have been given access to the
collection.
Delete a collection and all of its documents. This action can’t be
undone so please be careful.
List all published documents.List all your draft documents.
This method returns information for a document with a specific
ID. The following identifiers are allowed:
UUID - id field of the document
URI identifier - Human readable identifier used in Outline
URLs (e.g. outline-api-i48ZEZc5zjXndcP)
This methods allows you to search your teams documents with
keywords. Search results will be restricted to those accessible by
the current access token.
This method allows you to publish a new document under an existing
collection. By default a document is set to the parent collection
root. If you want to create a subdocument, you can pass{' '}
parentDocumentId to set parent document.
ID of the collection to which the document is
created
}
required
/>
ID of the parent document within the collection
}
/>
true by default. Pass false to
create a draft.
}
/>
This method allows you to modify already created document.
Pass true to publish a draft.
}
/>
Pass true to append the text parameter to the
end of the document rather than replace.
}
/>
Pass true to signify an autosave. This skips
creating a revision.
}
/>
Pass true to signify the end of an editing
session. This will trigger update notifications.
}
/>
Move a document to a new location or collection. If no parent
document is provided, the document will be moved to the collection
root.
Archive a document and all of its nested documents, if any.
Permanently delete a document and all of its nested documents, if
any.
Get a document with its ID or URL identifier from user’s
collections.
Restores a document to a previous revision by creating a new
revision with the contents of the given revisionId or restores an
archived document if no revisionId is passed.
Pins a document to the collection home. The pinned document is
visible to all members of the team.
Unpins a document from the collection home. It will still remain
in the collection itself.
Star (favorite) a document for authenticated user.
Unstar a starred (favorited) document for authenticated user.
Return recently viewed documents for the authenticated user
Return recently starred documents for the authenticated user
Return pinned documents for a collectionReturn a specific revision of a document.
Return revisions for a document. Upon each edit, a new revision is
stored.
This method allows you to create a new group to organize people in
the team.
This method allows you to update an existing group. At this time
the only field that can be edited is the name.
Deleting a group will cause all of its members to lose access to
any collections the group has been given access to. This action
can’t be undone so please be careful.
Returns detailed information on a group.
List all groups the current user has access to.
List members in a group, the query parameter allows filtering by
user name.
This method allows you to add a user to a group.
This method allows you to remove a user from a group.
List all your currently shared document links.
Creates a new share link that can be used by anyone to access a
document. If you request multiple shares for the same document
with the same user the same share will be returned.
Makes the share link inactive so that it can no longer be used to
access the document.
List all users that have viewed a document and the overall view
count.
Creates a new view for a document. This is documented in the
interests of thoroughness however it is recommended that views are
not created from outside of the Outline UI.
);
}
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;
`;
const Methods = (props: { children: React.Node }) => {
const children = React.Children.toArray(props.children);
const methods = children.map(child => child.props.method);
return (
{children}
);
};
const MethodContainer = styled.div`
margin-bottom: 80px;
`;
const Request = styled.h4`
text-transform: capitalize;
`;
type MethodProps = {
method: string,
label: string,
children: React.Node,
};
const Description = (props: { children: React.Node }) => (