Card layouts

This object represents a card layout in Recall. Card layouts define how fields are displayed in a card. There can be at most 5 card layouts per deck.

Endpoints

POST /v1/card_layouts # Create a new card layout
POST /v1/card_layouts/:id # Update a card layout
GET /v1/card_layouts # List all card layouts
GET /v1/card_layouts/:id # Get a card layout
DELETE /v1/card_layouts/:id # Delete a card layout

The card layout object

{
"id": "layout_yT9ktMcdzg4e",
"object": "card_layout",
"created_at": "2021-01-01T00:00:00Z",
"deck_id": "deck_5gvuzRdHW2ac",
"is_primary": true,
"is_active": true,
}
id string

The ID of the card layout.

object string, value is "card_layout"

The type of object.

card_layout_fields array of objectsExpandable

An array of the card layout fields objects belonging to the card layout. Only included in the response if the expand parameter includes card_layout_fields.

created_at string

The date and time the card layout was created. RFC 3339–formatted UTC datetime.

deck_id string

The ID of the deck the card layout belongs to.

is_primary boolean

Whether the card layout is the primary card layout of the deck. The primary card layout is the default layout used to display your cards. It can't be deleted.

When you set a layout to be primary, it will first verify that all the cards have at least a value in the front side of the card. If not, the request will fail and return an error. If it succeeds, the layout will be set as primary and other layouts will be set as not primary.

is_active boolean

Whether the card layout is currently being used to display cards in reviews.


Create a card layout

curl https://api.recall.cards/v1/card_layouts \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"deck_id": "deck_5gvuzRdHW2ac",
"is_active": true,
}'
deck_id string required

The ID of the deck the card layout belongs to.

is_primary boolean, default is false

Whether the card layout is the primary card layout of the deck. The primary card layout is the default layout used to display your cards. It can't be deleted.

When you create a primary layout, it will first verify that all the cards have at least a value in the front side of the card. If not, the request will fail and return an error. If it succeeds, the layout will be set as primary and other layouts will be set as not primary.

is_active boolean, default is true

Whether the card layout should be used to display cards in reviews.

Returns

Returns the created card layout object.


Update a card layout

curl https://api.recall.cards/v1/card_layouts/layout_yT9ktMcdzg4e \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"is_active": false,
}'
is_primary boolean, default is false

Whether the card layout is the primary card layout of the deck. The primary card layout is the default layout used to display your cards. It can't be deleted.

When you update a primary layout, it will first verify that all the cards have at least a value in the front side of the card. If not, the request will fail and return an error. If it succeeds, the layout will be set as primary and other layouts will be set as not primary.

is_active boolean, default is true

Whether the card layout should be used to display cards in reviews.

Returns

Returns the updated card layout object.


List all card layouts

curl https://api.recall.cards/v1/card_layouts \
-u YOUR_API_KEY: \
-d '{
"deck_id": "deck_5gvuzRdHW2ac"
}'
deck_id string

Filter the card layouts by the ID of the deck the card layout belongs to.

limit optional, default is 10

The maximum number of card layouts to return, ranging between 1 and 100.

starting_after optional

A cursor to use in pagination. starting_after is an object ID that defines your place in the list. For example, if you make a card list request and receive 100 cards, ending with card_2sdInOpM83eo, your subsequent call can include starting_after=card_2sdInOpM83eo to fetch the next page of the list.

ending_before optional

A cursor to use in pagination. Similarly to starting_after, ending_before is an object ID that allows you to fetch object in the previous page of the list.

Returns

{
"object": "list",
"has_more": false,
"data": [
// Card layout objects...
],
}
object string, value is "list"

The type of object returned.

data array

An array containing the card layout objects.

has_more boolean

Whether or not there are more elements available after this set. If false, this set comprises the end of the list.


Get a card layout

curl https://api.recall.cards/v1/card_layouts/layout_yT9ktMcdzg4e \
-u YOUR_API_KEY:

There are no parameters for this endpoint.

Returns

Returns the card layout object.


Delete a card layout

Deleting a card layout will also delete all its card layout fields.

curl https://api.recall.cards/v1/card_layouts/layout_yT9ktMcdzg4e \
-u YOUR_API_KEY: \
-X DELETE

There are no parameters for this endpoint.

Returns

Returns the deleted card layout object.

{
"id": "layout_yT9ktMcdzg4e",
"object": "card_layout",
"deleted": true
}
Card layouts | Recall API reference